Splitting the slots table
Phil Longstaff
plongstaff at rogers.com
Mon Jan 3 13:24:30 EST 2011
See below prefixed by [Phil]. I've also prefixed Derek's comments with [Derek]
where there might be confusion.
Phil
---------
I used to be a hypochondriac AND a kleptomaniac. So I took something for it.
________________________________
From: Derek Atkins <warlord at MIT.EDU>
To: John Ralls <jralls at ceridwen.us>
Cc: Phil Longstaff <plongstaff at rogers.com>; Gnucash Devel Mailing List
<gnucash-devel at gnucash.org>
Sent: Mon, January 3, 2011 12:00:14 PM
Subject: Re: Splitting the slots table
John Ralls <jralls at ceridwen.us> writes:
> We need to re-think KVP entirely: It doesn't match up very well with
> the relational model.
Yeah. The KVP model works great for XML extensibility. It does suck
for SQL extensibility.
[Derek] As we move forward I think we need to think about both methods. We have
some requirements in that object A needs to somehow mark/tag object B
but Object B doesn't know about said tagging. I'm not sure how you go
about doing that in a full relational database. I suppose you could
have a "object B tag from object A" table using a foreign key, but then
you have to do a table join to get the data out,
[Phil] Which object would do the join? For object B to load the info, it needs
to know about object A's table. I suppose object A could load a sub-object and
tack it onto object B. That might, in fact, be the best option. Object B loads
its stuff as normal. Object A then loads its stuff into a struct and registers
that struct with object B using the name "Object A's additions". It could then
get its stuff back, and when registering, there could be added callbacks to be
used when object B is deleted or saved.
[Derek] and you need to make
sure that you remove the data from this new table if the object is
removed from the main table.....
[Phil] Can this not be done with the foreign key constraint using ON DELETE
CASCADE (I think that's it)?
It all gets very complicated very quickly.
-derek
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord at MIT.EDU PGP key available
More information about the gnucash-devel
mailing list