Re: IsA on a PK in both tables
[prev]
[thread]
[next]
[Date index for 2005/03/03]
--- William McKee <william@xxxxxxx.xxx> wrote:
> On Thu, Mar 03, 2005 at 07:18:15AM -0800, Peter Speltz wrote:
> Is that because dialup_object.id is_a InterentService object? Can
> you post your class setup?
>
Yes i believe so if i understand what your saying.
I thought i did post my class setup. Here's a brief.
IntrntSrvc->columns(All=>qw/is_id ..../); # is_id is autoincrement pk
Dialup->columns (All => qw/is_id port_limit IntrnSrvc_col1 .../); # pk is is_id
(not autoinc)
Dialup->is_a(is_id => IntrntSrvc); # is_a on PK
I thought a IsA like this would be pretty common. Im no DBA but i did take a
database class and this is how I designed my is_a relationships. The dialup
table is basically just a subclass of IntrntSrvc . I have other sub classes --
Domain, Email, DSL, etc. Is this bad design that they should share a PK.
I could add a auto_inc pk to Dialup just for sake of simplicity with CDBI::ISA
but for relational and data purposes its not necessary.
BTW -- i checked the code and it looks like IsA.pm uses the inflated accessor
(Dialup->is_id in my case) intensely.
thanks
=====
pjs
__________________________________
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/
|
(message missing)
|