Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Best Method of Object-Oriented Behavior Addition?

by jreades (Friar)
on Sep 29, 2000 at 19:25 UTC ( [id://34619]=note: print w/replies, xml ) Need Help??


in reply to Best Method of Object-Oriented Behavior Addition?

Is the special case exclusive? Meaning, is it a case the all objects of class 'Y' will behave differently based on the command-line switch? Or is it just once in a while?

Based on the answer to that you have two choices:

  • Intermittent behaviour: your solution is an excellent one (extending won't work)
  • Consistent behaviour: I'd change the constructor so that the method itself works differently

my $0.02

  • Comment on Re: Best Method of Object-Oriented Behavior Addition?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found