Re: IsA on a PK in both tables

[prev] [thread] [next] [Date index for 2005/03/03]

From: Peter Speltz
Subject: Re: IsA on a PK in both tables
Date: 16:24 on 03 Mar 2005
--- 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)

IsA on a PK in both tables
Peter Speltz 23:01 on 01 Mar 2005

Re: IsA on a PK in both tables
Peter Speltz 23:39 on 01 Mar 2005

Re: IsA on a PK in both tables
Matt S Trout 02:02 on 02 Mar 2005

Re: IsA on a PK in both tables
Peter Speltz 04:33 on 02 Mar 2005

Re: IsA on a PK in both tables
William McKee 14:24 on 03 Mar 2005

Re: IsA on a PK in both tables
Peter Speltz 15:18 on 03 Mar 2005

Re: IsA on a PK in both tables
William McKee 15:52 on 03 Mar 2005

Re: IsA on a PK in both tables
Peter Speltz 16:24 on 03 Mar 2005

Generated at 00:32 on 04 Mar 2005 by mariachi v0.52