Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^4: OO design: abstract class or can()?

by adrianh (Chancellor)
on Mar 24, 2007 at 20:52 UTC ( #606432=note: print w/ replies, xml ) Need Help??


in reply to Re^3: OO design: abstract class or can()?
in thread OO design: abstract class or can()?

It's also a nice bit of future-proofing in case Perl ever gets multi-dispatch... and that day may be closer than many people think. (I mean dispatch based on role, not structural type.)

Meh. Still think it would be simpler without the "if". Spinning out the calling behaviour from the thing being called feels odd to me.

If the calling is independent of the class then something AOPish would seem appropriate. If not then having e the base class have that trait with a null method rather than have a condition on something that may not be present seems cleaner to me.


Comment on Re^4: OO design: abstract class or can()?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2014-08-30 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls