RE: more on inherited classes

[prev] [thread] [next] [Date index for 2004/07/28]

From: Dana Hudes
Subject: RE: more on inherited classes
Date: 01:33 on 28 Jul 2004
Todd Lorenz <trlorenz@xxxxxxx.xxx> wrote:

>Had some related problems myself trying to create subclasses of CDBI
>classes. Something basic like...

>CDBI::Person

>...works fine, of course. But something like...

>CDBI::Person::Policeman

>...doesn't work so well. Any Essentials in Person are not available to
>Policeman.

>The fault, I believe, is with the __PACKAGE__->columns(Essential => ...)
>call. It *sets* Essentials for a class, it does not *add* to them, so
>basically your Policeman Essentials are wiping out your Person Essentials 
in
>the Policeman package. (I mentioned this to the mailing list, but it 
wasn't
>a very hot topic. Actually, Perrin suggested I use a different group
>entirely for Policeman, like SpecialGroup or something, but the problem, 
of
>course, is that SpecialGroup wouldn't have Essential behavior.)

Thanks for the example and the suggested workaround. As I'm somewhat a 
more ambitious,
determined sort not to mention perhaps tending to muck around inside 
things because
I can....

The trouble is that each Essential is run in its particular class.
If you check the Essentials for Person , they're still there Policeman 
didn't clobber those values.
It simply never got them.
Inheritance is the key here....more when I locate the code...



more on inherited classes
Dana Hudes 22:33 on 27 Jul 2004

RE: more on inherited classes
Dana Hudes 01:33 on 28 Jul 2004

Re: more on inherited classes
Charles Bailey 01:48 on 28 Jul 2004

Re: more on inherited classes
Dana Hudes 02:03 on 28 Jul 2004

Re: more on inherited classes
Tony Bowden 06:38 on 28 Jul 2004

Generated at 11:35 on 01 Dec 2004 by mariachi v0.52