Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Implementing a Mixin Class

by adrianh (Chancellor)
on May 31, 2004 at 16:08 UTC ( #357813=note: print w/replies, xml ) Need Help??


in reply to Implementing a Mixin Class

I don't really think a consensus has been reached. I'd probably use your first multiple-inheritance based option myself.

Your second and third options are really the same thing. Exporter is just a standard mechanism for supplying import based symbol table fiddling.

Perl 6 is looking to generalise "mixin" type behaviour a bit with Traits (called 'roles' in Perl 6). You might want to take a look at some of the Perl 5 implementations of this strategy (Class::Role, Class::Roles, Class::Trait).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2019-10-21 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?