Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re3: The costs of packages

by BrowserUk (Pope)
on Sep 17, 2003 at 13:26 UTC ( #292184=note: print w/replies, xml ) Need Help??


in reply to Re3: The costs of packages
in thread The costs of packages

Like Abigail, I haven't really thought the inheritance thing through fully as I haven't the need for it, but what you say makes sense as far as I can tell. Once the package is initially generated it should act just like any other class (assuming you generate the right stuff:).

Perhaps the only awkward bit would be managing the process of generating superclasses if the user instantiates an instance of a subclass 2 or 3 levels down in a subclass hierachy?

use Class::AutoFactory; my $rover = new Dog; # Is a subclass of Canine # Is subclass of Mammal # Is a subclass of Animal.

Ensuring that each of the parent classes comes into being in the right order would require a fairly detailed map of the class hierachy and might be a bit complex to program. Doable, but it would require a fair amount of thoughtful design to get it right in a way that is easily extensible and maintainable.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
If I understand your problem, I can solve it! Of course, the same can be said for you.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://292184]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2019-03-20 23:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How do you Carpe diem?





    Results (105 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 18:53 UTC) Welcome new users!