Re: IsA on a PK in both tables

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

From: Peter Speltz
Subject: Re: IsA on a PK in both tables
Date: 23:39 on 01 Mar 2005
Another thing is in the template when is say:
[%Dialup.id %] stringification of the IntrntSrvc object occurs. :) This
inflation on PK i don't want or need and i think is heart of problems or what
i'm scared of. I think this is a bug because if something truly is_a something
else, they should share the same key.  And you shouldn't inflate a PK in CDBI,
right?

I have Dialup, DSL, Domain Email all of which are internet services. Customer
has_many IntrntSrvcs but they view edit and create Dialups , Domains etc. Its
the textbook IsA rel.  Its beutiful how IsA simplifies the flow and code. I'm
really excited about it:)

One more question:
The only thing that could make this setup better is if i had a Base Sub class
for Dialup , Domain, DSL, etc to specify the IsA inheritance since its same for
each..  nOW I have this in
evey one of my specific services. Like 7 of them.
 
__PACKAGE__->is_a(is_id-> IntrntSrvc);
__PACKAGE__->columns('All' => qw/is_id price type .../); # inherit columns
 # first 10 columns from is_a in list and same in every file.

Its very error prone and ugly and hard to maintain.
There has to be a better way but i don't know it.

thanks




--- Peter Speltz <peterspeltz@xxxxx.xxx> wrote:

> Anyone have any experience with using IsA on the  single PK  of the related
> tables?  I'm having a problem or two and don't know if i'm asking too much. 
> 
> My setup is two tables intrnt_srvc and dialup:
> 
> IntrntSrvc is base, Pk name is "is_id" and Dialup PK name is "is_id"
> Dialup->is_a('is_id' => IntrntSrvc);
> 
> That's the set up and its exactly what i want. and i think exactly what is_a
> is
> for. 
> 
> When i do dialup->create it beautifully creates the the intrnt_srvc too.
> Deleting it doesn't cascade delete and i'm having trouble getting my before
> delete trigger to work.
> 
> That's pretty much it. Mainly i'm curious how other people get on with a
> setup
> like this. 
> 
> thanks
> 
> =====
> pjs
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Yahoo! Mail - Helps protect you from nasty viruses. 
> http://promotions.yahoo.com/new_mail
> 


=====
pjs


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250

(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