[CDBI] Re: ChildOf

[prev] [thread] [next] [Date index for 2005/09/10]

From: Edward J. Sabol
Subject: [CDBI] Re: ChildOf
Date: 00:46 on 10 Sep 2005
> Good point. Forgot to explain. The problem with has_a is that it takes
> your primary column, your object id (that you are probably using
> everywhere in urls, keys, etc) and turns it into a parent object.

Huh? No, it doesn't. It will take the child's foreign key column and turn it
into a parent object. Is that what you meant? Has_a doesn't do anything to
the primary key unless you specifiy a has_a on the primary key, and that's
explicitly discouraged in the CDBI documentation and leads to broken behavior.

> That's not very nice from two perspectives:

> #1. I like my id where it is! :-) I mean, really - when I say <a
> href="/?a_id=<%$link->link_id%>"> I expect a number to show up. (I
> believe it actually will - because of stringify - but read on).

Most people using CDBI really don't fiddle with stringification. It's almost
never a good idea. Personally, I would just use $link instead of
$link->link_id.

> #2. I don't want to go to the database for the parent just because I am
> accessing the child's id.

OK, that's valid. There is some overhead here, but CDBI goes to the database
for a lot of things that you wouldn't think it would go to the database for.
I suspect it's barely another drop in the bucket.

It sounds like ChildOf is just HasAWithSpecifiedAccessorName, which certainly
could be useful. I'd almost suggest that you add the accessor name capability
to HasA instead of proliferating a new Relationship, but you'd have to go
through Tony for that and he may or may not be receptive to such an
enhancement.

Later,
Ed

P.S. Kate, you keep breaking the message threading with your responses. I
suspect you are hitting the "f" key (or similar) in your mail program
(technically, a mail user agent or MUA) because you think "f" does a
"follow-up", like in many newsreaders. But you are actually "forwarding" your
response to the mailing list. What you want is a "group reply." Forwarding
changes the Subject: header and discards the References: and In-Reply-To:
headers, which makes automatic discussion threading impossible. If your MUA
doesn't have "group reply" functionality, then please just reply and then
change the To: header to point to the mailing list. Thanks!

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

FW: [CDBI] ChildOf
Kate Yoak 00:10 on 10 Sep 2005

Re: FW: [CDBI] ChildOf
Jay Strauss 00:29 on 10 Sep 2005

[CDBI] Re: ChildOf
Edward J. Sabol 00:46 on 10 Sep 2005

[CDBI] RE: ChildOf
Kate Yoak 01:30 on 10 Sep 2005

Generated at 13:57 on 10 Sep 2005 by mariachi v0.52