Re: Stolen Ideas

[prev] [thread] [next] [Date index for 2004/08/10]

From: Scott McWhirter
Subject: Re: Stolen Ideas
Date: 20:42 on 10 Aug 2004
Tony Bowden wrote:

> On Tue, Aug 10, 2004 at 08:18:26PM +0100, Scott McWhirter wrote:
> 
>>Keyed and indexed relationships.
>>Arrays and hashs and attributes (Intrusive).

> In language that simpletons can follow?
> 
> Or even examples?

okay... for you to follow:

--------------

We have two classes, represented by the tables: Brewery and Beer. The 
relationship between them is 1..* (has_many) - BUT - for purposes of 
this discussion, assume that we don't want to get ALL the Beer objects 
in a set everytime, instead, we want to create a new type of 
relationship called has_many_keyed. This will allow us to say the 
equivalent of...

$homers_fave = $my_brewery->{'Duff'};
     OR
$my_brewery->{'Duff'} = $my_beer;

However, we'll do this using accessors (the former will requre some TIE 
magic)...

$homers_fave = $my_brewery->get_beer_by_key('Duff');
     OR
$my_brewery->set_beer_by_key('Duff', $my_beer);

Indexed relationships are the same, except that order is preserved, and 
instead of keys you use integers (Arrays).

The essential difference is that you're not loading the objects on the 
many side as a set (even if there is just one element in the set), 
instead you just get the one that you want. Tangram has these features.

Distinct from this is Arrays and Hashes which are INTERNAL to the 
objects. That is, they don't represent a relationship between two 
classes, but store a serialised Array or Hash of flat values in a field 
in the table. Beer could therefore have a field called "awards" which 
could be saved as a comma delimited string in the field in the table - 
the accessors for this would split the string on the delimiter to turn 
it back into an array, or, to insert it, the list could be joined with a 
delimiter (after any commas in the values are escaped, of course). 
Internal hashes could be implemented in a similar way.

The whole purpose of this is to build an orthogonal object-relational 
mapping to take on Tangram - which would be fantastic because debugging 
with Tangram is bloody near impossible due to poor input marshalling and 
virtually non existent error handling and bogus error messages.

Hope that clears it up for the simpletons, etc.


        -- 
        -Scott McWhirter- | -kungfuftr-

(message missing)

Stolen Ideas
Tony Bowden 18:58 on 10 Aug 2004

Re: Stolen Ideas
ed-cdbi 19:03 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 19:06 on 10 Aug 2004

Re: Stolen Ideas
ed-cdbi 19:08 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 19:11 on 10 Aug 2004

Re: Stolen Ideas
ed-cdbi 19:19 on 10 Aug 2004

RE: Stolen Ideas
Thomas, Mark - BLS CTR 19:11 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 19:27 on 10 Aug 2004

Re: Stolen Ideas
Nelson C. T. Ferraz 15:14 on 12 Aug 2004

Re: Stolen Ideas
Scott McWhirter 19:18 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 19:28 on 10 Aug 2004

Re: Stolen Ideas
Scott McWhirter 20:42 on 10 Aug 2004

Re: Stolen Ideas
Perrin Harkins 21:08 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 21:33 on 10 Aug 2004

Re: Stolen Ideas
Scott McWhirter 22:58 on 10 Aug 2004

Re: Stolen Ideas
Perrin Harkins 23:23 on 10 Aug 2004

Re: Stolen Ideas
Gregory P. Smith 19:55 on 10 Aug 2004

Re: Stolen Ideas
Perrin Harkins 20:02 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 21:47 on 10 Aug 2004

Re: Stolen Ideas
Perrin Harkins 22:23 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 22:37 on 10 Aug 2004

Re: Stolen Ideas
Perrin Harkins 22:57 on 10 Aug 2004

Re: Stolen Ideas
Yuval Kogman 15:39 on 11 Aug 2004

Re: Stolen Ideas
Tony Bowden 22:02 on 10 Aug 2004

Re: Stolen Ideas
ed-cdbi 22:11 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 22:25 on 10 Aug 2004

Re: Stolen Ideas
Tim Bunce 08:53 on 24 Aug 2004

Re: Stolen Ideas
Perrin Harkins 22:16 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 22:42 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 22:16 on 10 Aug 2004

Re: Stolen Ideas
Tony Bowden 23:18 on 10 Aug 2004

Re: Stolen Ideas
Scott McWhirter 23:48 on 10 Aug 2004

Re: Stolen Ideas
Perrin Harkins 00:22 on 11 Aug 2004

Re: Stolen Ideas
Perrin Harkins 03:45 on 11 Aug 2004

Re: Stolen Ideas
Tony Bowden 08:36 on 11 Aug 2004

Re: Stolen Ideas
Aaron Trevena 19:05 on 13 Aug 2004

Re: Stolen Ideas
Aaron Trevena 17:13 on 15 Aug 2004

Re: Stolen Ideas
Dan Friedman 04:47 on 11 Aug 2004

Re: Stolen Ideas
Tony Bowden 08:39 on 11 Aug 2004

Re: Stolen Ideas
Branislav Zahradnik 15:21 on 11 Aug 2004

RE: Stolen Ideas
Thomas, Mark - BLS CTR 19:13 on 13 Aug 2004

Re: Stolen Ideas
Tony Bowden 23:16 on 10 Aug 2004

Re: Stolen Ideas
Perrin Harkins 23:42 on 10 Aug 2004

Re: Stolen Ideas
Tim Bunce 08:48 on 24 Aug 2004

Re: Stolen Ideas
Tony Bowden 21:57 on 11 Aug 2004

Re: Stolen Ideas
Simon Cozens 09:03 on 24 Aug 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52