in reply to Re: Re: Re: inheritance and can
in thread inheritance and can
That's not strictly true, the object is created by Class::DBI itself (usually after a ->retrieve()), all that the init does is rebless the object to a more "specific" class, if you will. Simply renaming the method is certainly the easiest way to do it (and probably I'll end up doing that); however, hypothetically speaking, there is no reason (apart from sanity) why the init on the more specific class wouldn't do the same thing - rebless to a yet more specific class and init that.
It's easy to imagine a more general hiearchy of related classes being stored in the same table, each having to descend through some number of these init's until it gets to it's final class. Of course a better way of doing that would probably be a factory that immediately reblesses to the final class that the record ends up with, whose init travels up the inheritance tree with SUPER. (though it is possible to imagine that you need the intermediate classes to decided what class the next step should be)
Not that I would ever want to do such a thing, but I was still curious.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: inheritance and can
by bean (Monk) on Aug 10, 2003 at 08:02 UTC |