Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Confused about splitting program into multiple files.

by davido (Cardinal)
on Feb 15, 2004 at 16:16 UTC ( [id://329130]=note: print w/replies, xml ) Need Help??


in reply to Re: Confused about splitting program into multiple files.
in thread Confused about splitting program into multiple files.

Ok, here's a question though. What made you choose to

use Class::MethodMaker;

instead of

use base Class::MethodMaker;

or

use Class::MethodMaker; our @ISA = qw/Class::MethodMaker/;

In other words, when should you choose inheritance rather than simple use? The barometer that I've kind of adopted is if I want my object or class to behave as a parent class, inherit. It seems that Class::MethodMaker is one of those cases.

Please forgive my continued novicity on this subject. ;)


Dave

Replies are listed 'Best First'.
3Re: Confused about splitting program into multiple files.
by jeffa (Bishop) on Feb 15, 2004 at 16:28 UTC

    Because i still forget from time to time that one should always "favor aggregation over inheritance." :)

    UPDATE:
    Or am i second guessing myself again? Yes ... never mind my reply, i thought you were referring to something else. (But the concept of aggregation vs. inheritance is still important.)

    My usage simply follows what is illustrated in the POD. There is some syntactical sugar involved, so i don't read into the "useage" too literally -- think of Class::MethodMaker as magic. :)

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2025-03-24 19:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (65 votes). Check out past polls.

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.