relationship namespace

[prev] [thread] [next] [Date index for 2004/12/20]

From: William Ross
Subject: relationship namespace
Date: 11:42 on 20 Dec 2004
dear tony, list,

I'm having trouble with classes stamping on each others' relationships, 
and since relationships are such a *** to debug just now, I wonder 
whether anyone can narrow the field a bit.

Most of my HasA relationships point nicely to the monikered class, but 
I'm in the habit of using parent() to refer to an object of the present 
class, and if I do this:

Delivery::Discussion::Message->has_a( parent => 'Delivery:: 
Discussion::Message' );
Delivery::Project->has_a( parent => 'Delivery::Project' );

The Project relationship overwrites the Message one, and I get project 
objects when I call $message->parent.

Picking through the metadata reveals that all my classes have the same 
has_a set, ie that the metadata hash is shared among all cdbi 
subclasses rather then existing separately in each. Normally this is 
fine, since a 'clip' relationship always refers to the clips table in 
the same way, but as you can see there are cases where it's not fine.

Is there something I'm doing wrong that means the relationship data is 
being held at too high a level in the inheritance tree, or is this just 
how it works?

thanks

will

relationship namespace
William Ross 11:42 on 20 Dec 2004

Re: relationship namespace
Tony Bowden 12:01 on 20 Dec 2004

Re: relationship namespace
William Ross 12:20 on 20 Dec 2004

Re: relationship namespace
William Ross 22:10 on 20 Dec 2004

Re: relationship namespace
Tony Bowden 23:09 on 20 Dec 2004

Generated at 12:15 on 16 Jan 2005 by mariachi v0.52