Re: IsA on a PK in both tables
[prev]
[thread]
[next]
[Date index for 2005/03/02]
thank you. that's great.
Does anyone else think that IsA inflating a primary key is a bug?
--- Matt S Trout <cdbi-talk@xxxxx.xx.xx> wrote:
> On Tue, Mar 01, 2005 at 03:39:59PM -0800, Peter Speltz wrote:
> > 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.
>
> package BaseClass;
>
> sub setup_self {
> my ($class, @cols) = @_;
> $class->is_a(is_id => 'BaseClass');
> $class->columns('All' => qw/... first 10 cols .../, @cols);
> }
>
> package SubClass;
>
> __PACKAGE__->setup_self(qw/specific columns for this subclass/);
>
> That should reduce the amount of duplication involved.
>
> --
> Matt S Trout Brag sheet: http://trout.me.uk/services.html
> LAMP, Infrastructure Contact: services@xxxxx.xx.xx
> and Automation
> specialist Do it once. Do it
> right.
>
=====
pjs
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail
|
(message missing)
|