Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

(tye)Re: OO-style question

by tye (Cardinal)
on Dec 30, 2000 at 00:58 UTC ( #48894=note: print w/ replies, xml ) Need Help??


in reply to OO-style question

To answer this question well, we need more concrete information so we can make a call as to whether A is a B, B is an A, A is a Base, B is a Base, etc.

But another option is that B can dispatch to A in any number of ways. The two simplest are:

sub B::same { goto &A::same } # or *B::save= \&A::save;
I'll add that inheritance, especially in Perl, should be saved as a last resort. Perl's inheritance is just way too clumsy, being very all-or-nothing.

        - tye (but my friends call me "Tye")


Comment on (tye)Re: OO-style question
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (16)
As of 2015-07-30 13:29 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 (271 votes), past polls