Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: I don't think inheritance is essential

by sri (Vicar)
on Sep 02, 2005 at 00:05 UTC ( #488516=note: print w/ replies, xml ) Need Help??


in reply to Re^2: I don't think inheritance is essential
in thread Advanced Perl Programming, 2nd edition

Yes, multiple inheritance is quite lame for mixin style programming, but try to think a bit more abstract.
The important part is that we use it in combination with NEXT for AOP like programming, think AspectJ without static trigger points!

package Foo; use base qw/Bar::Unicode Bar/; __PACKAGE__->prepare_parameters; package Bar; sub prepare_parameters { my $class = shift; # initialize parameters... } package Bar::Unicode; use NEXT; sub prepare_parameters { my $class = shift; # let parent initialize parameters $class->NEXT::prepare_parameters; # utf8 encode parameters... }
Hope this makes it a bit clearer.


Comment on Re^3: I don't think inheritance is essential
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2015-07-31 09:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (276 votes), past polls