RE: more on inherited classes
[prev]
[thread]
[next]
[Date index for 2004/07/28]
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...
|
|
RE: more on inherited classes
Dana Hudes 01:33 on 28 Jul 2004
|