From: Vsevolod (S. I. <il...@cs...> - 2004-02-16 01:48:53
|
Hi, I was wondering how people here manage relationships with multiple=20 girlfr... Oops, wrong mailing list. :) I was wondering if it's possible to implement in SPOPS "has_many"=20 relationship (in addition to "has_a" and "links_to"). Obviously, it can=20 be done through "links_to", but at the cost of an additional database=20 table which makes things more cumbersome. For things like a bug=20 database, where one software project references several bugs, but no=20 bugs belong to more than one software project, "links_to" is an=20 overkill. If the id of the owner is stored in a field of the owned=20 object, the implementation can be similar to the already existing code=20 for the other relationships. Chris, if you think it's a good idea, I could implement it. I would only=20 request from you pointers to all the places that should be modified. Thanks, Simon --=20 Simon (Vsevolod ILyushchenko) si...@cs... http://www.simonf.com The unknown is honoured, the known is neglected - until all is known. The C=FA Chulaind myth |
From: Ray Z. <rz...@co...> - 2004-02-16 15:52:21
|
On Feb 15, 2004, at 8:45 PM, Vsevolod (Simon) Ilyushchenko wrote: > I was wondering if it's possible to implement in SPOPS "has_many" > relationship (in addition to "has_a" and "links_to"). Obviously, it > can be done through "links_to", but at the cost of an additional > database table which makes things more cumbersome. For things like a > bug database, where one software project references several bugs, but > no bugs belong to more than one software project, "links_to" is an > overkill. If the id of the owner is stored in a field of the owned > object, the implementation can be similar to the already existing code > for the other relationships. When you talk about a "has-many" relationship, I think you are just looking at the other end of a has-a relationship, right? To use your example, a bug has-a project that it belongs to. If I interpret correctly what it is that you want, you're looking for the ability to define a relationship that would automatically generate methods in your "software project" object to fetch the corresponding list of bugs, for example. If so, I invested some effort a few years ago in defining a generalized relationship configuration syntax which handles this case (as well as the has-a and links-to). You can find my proposal in the openinteract-dev archives. The first one [1], posted on 7/3/01 is quite long and spells things out in pretty much detail. The second [2] was posted in Jan 2002 and includes some additions and updates to the proposed design. At the time, Chris seemed pretty interested in eventually having some variation of this design included in SPOPS. I've implemented only small pieces of it for my own use and I suspect it just that on Chris's end it just came down to a shortage of tuits. Assuming I've interpreted correctly what you want, I would encourage you to have a look at what I proposed. It would be really wonderful if it addresses what you need and you actually have some time to implement it and get it incorporated officially into SPOPS. [1] http://www.geocrawler.com/archives/3/8393/2001/7/0/6095774/ [2] http://www.geocrawler.com/archives/3/8393/2002/1/0/7464826/ Ray Zimmerman Director, Laboratory for Experimental Economics and Decision Research 428-B Phillips Hall, Cornell University, Ithaca, NY 14853 phone: (607) 255-9645 fax: (815) 377-3932 |
From: Vsevolod (S. I. <si...@cs...> - 2004-02-16 21:30:37
|
Ray, > When you talk about a "has-many" relationship, I think you are just > looking at the other end of a has-a relationship, right? To use your=20 > example, a bug has-a project that it belongs to. If I interpret=20 > correctly what it is that you want, you're looking for the ability to=20 > define a relationship that would automatically generate methods in your= =20 > "software project" object to fetch the corresponding list of bugs, for=20 > example. And vice versa, I want to be able to fetch the project object that a bug=20 object belongs to. > If so, I invested some effort a few years ago in defining a generalized= =20 > relationship configuration syntax which handles this case (as well as=20 > the has-a and links-to). You can find my proposal in the=20 > openinteract-dev archives. The first one [1], posted on 7/3/01 is quite= =20 > long and spells things out in pretty much detail. The second [2] was=20 > posted in Jan 2002 and includes some additions and updates to the=20 > proposed design. Chris actually sent me those links a while ago. This approach may be=20 more than I bargained for, but if that's the right solution, I could=20 take a stab at it, provided Chris agrees. However, after reading your posts it seems to me that you only talk=20 about a many-to-many relationship: you always have X between A and B. I really want to have a system that can handle simple cases of=20 one-to-one and one-to-many relationships with only two tables/objects,=20 as having three tables is inconvenient from the DBA's point of view and=20 should be avoided when possible. > At the time, Chris seemed pretty interested in eventually having some=20 > variation of this design included in SPOPS. I've implemented only small= =20 > pieces of it for my own use and I suspect it just that on Chris's end i= t=20 > just came down to a shortage of tuits. [Sun Feb 16 16:20:37 2004] [error] [client 143.48.3.90] error parsing=20 "tuits". Word not in dictionary due to foreign classes in the=20 inheritance tree. Simon --=20 Simon (Vsevolod ILyushchenko) si...@cs... http://www.simonf.com The unknown is honoured, the known is neglected - until all is known. The C=FA Chulaind myth |
From: Ray Z. <rz...@co...> - 2004-02-16 22:05:23
|
On Feb 16, 2004, at 4:26 PM, Vsevolod (Simon) Ilyushchenko wrote: >> If I interpret correctly what it is that you want, you're looking >> for the ability to define a relationship that would automatically >> generate methods in your "software project" object to fetch the >> corresponding list of bugs, for example. > > And vice versa, I want to be able to fetch the project object that a > bug object belongs to. Right, these are the forward and reverse direction fetching methods I talk about. I'd have to dig back into the details again, but I think my design assumes you want one or the other, but not both. That could probably be added. > Chris actually sent me those links a while ago. This approach may be > more than I bargained for, but if that's the right solution, I could > take a stab at it, provided Chris agrees. Obviously, I'm biased :-), but I would rather see effort put into moving to this more general structure rather than adding onto the existing more limited one. > However, after reading your posts it seems to me that you only talk > about a many-to-many relationship: you always have X between A and B. > I really want to have a system that can handle simple cases of > one-to-one and one-to-many relationships with only two tables/objects, > as having three tables is inconvenient from the DBA's point of view > and should be avoided when possible. Actually, no. I used the three classes X, A and B just to define some minimal notation that I could use to talk about all of the above relationships. For simple one-to-one and one-to-many relationships, just look at X and A (pretend you don't have B). See the first 3 examples at the end of the first post. The proposed structure just attempts to handle all of the relationships using a single generalized has-a configuration: * one-to-one: X has-a A, X is the main object with a method to fetch it's corresponding A * one-to-many: X has-a A, A is the main object, with a method to fetch it's many X's * many-to-many: X has-a and X has-B, X is a linking object between A and B, and A has a method to fetch all of the linked B's (or vice versa). I hope this helps. Ray Zimmerman Director, Laboratory for Experimental Economics and Decision Research 428-B Phillips Hall, Cornell University, Ithaca, NY 14853 phone: (607) 255-9645 fax: (815) 377-3932 |
From: Vsevolod (S. I. <si...@cs...> - 2004-02-16 23:36:40
|
> Obviously, I'm biased :-), but I would rather see effort put into movin= g=20 > to this more general structure rather than adding onto the existing mor= e=20 > limited one. I'm with you. I have already been bitten by the problem of manually=20 managing the order of saving members of composite objects (ie, has_a=20 members have to be saved before the parent object, but links_to members=20 have to be saved after it) - I'd rather specify it in the configuration. > Actually, no. I used the three classes X, A and B just to define some=20 > minimal notation that I could use to talk about all of the above=20 > relationships. For simple one-to-one and one-to-many relationships, jus= t=20 > look at X and A (pretend you don't have B). See the first 3 examples at= =20 > the end of the first post. Gotcha. Chris, what do you think? With my current amount of free time I could expect to implement this by summer. Simon --=20 Simon (Vsevolod ILyushchenko) si...@cs... http://www.simonf.com The unknown is honoured, the known is neglected - until all is known. The C=FA Chulaind myth |
From: Chris W. <ch...@cw...> - 2004-02-18 13:46:26
|
On Feb 16, 2004, at 6:32 PM, Vsevolod (Simon) Ilyushchenko wrote: >> Actually, no. I used the three classes X, A and B just to define some >> minimal notation that I could use to talk about all of the above >> relationships. For simple one-to-one and one-to-many relationships, >> just look at X and A (pretend you don't have B). See the first 3 >> examples at the end of the first post. > > Gotcha. Chris, what do you think? With my current amount of free time > I could expect to implement this by summer. I am so there. Working on OI and my day job leaves little time (tuits!) to do SPOPS work except obvious bugfixes. So make it happen, and if you need anything from me please let me know. Chris -- Chris Winters Creating enterprise-capable snack systems since 1988 |
From: Ray Z. <rz...@co...> - 2004-02-18 14:56:40
|
On Feb 18, 2004, at 8:41 AM, Chris Winters wrote: > On Feb 16, 2004, at 6:32 PM, Vsevolod (Simon) Ilyushchenko wrote: >>> Actually, no. I used the three classes X, A and B just to define >>> some minimal notation that I could use to talk about all of the >>> above relationships. For simple one-to-one and one-to-many >>> relationships, just look at X and A (pretend you don't have B). See >>> the first 3 examples at the end of the first post. >> >> Gotcha. Chris, what do you think? With my current amount of free time >> I could expect to implement this by summer. > > I am so there. Working on OI and my day job leaves little time > (tuits!) to do SPOPS work except obvious bugfixes. So make it happen, > and if you need anything from me please let me know. > > Chris Of course, I'm happy to help out with refinements to the design and with testing as time allows. I expect there will be more discussion as Simon's implementation progresses ... should we move that to the dev list? Ray Zimmerman Director, Laboratory for Experimental Economics and Decision Research 428-B Phillips Hall, Cornell University, Ithaca, NY 14853 phone: (607) 255-9645 fax: (815) 377-3932 |
From: Ray Z. <rz...@co...> - 2004-02-16 22:14:09
|
On Feb 16, 2004, at 4:26 PM, Vsevolod (Simon) Ilyushchenko wrote: > >> At the time, Chris seemed pretty interested in eventually having some >> variation of this design included in SPOPS. I've implemented only >> small pieces of it for my own use and I suspect it just that on >> Chris's end it just came down to a shortage of tuits. > > [Sun Feb 16 16:20:37 2004] [error] [client 143.48.3.90] error parsing > "tuits". Word not in dictionary due to foreign classes in the > inheritance tree. :-) Right, sorry. I'm not totally sure of the history of that "term". You often hear someone say, they'll do something when they "get around to it", meaning when they find the time. I imagine someone, somewhere changed it to "get a round tuit" so they could blame their failure to complete some task on the lack of "round tuits". Ray Zimmerman Director, Laboratory for Experimental Economics and Decision Research 428-B Phillips Hall, Cornell University, Ithaca, NY 14853 phone: (607) 255-9645 fax: (815) 377-3932 |