Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: normal objects?

by mkmcconn (Chaplain)
on Jan 25, 2001 at 01:14 UTC ( [id://54128]=note: print w/replies, xml ) Need Help??


in reply to Re: normal objects?
in thread normal objects?

tadman, the part you describe is easier than I thought it would be. But (pardon me for thinking out loud - I promise to read the docs) what if $bessie has the $bessie->eat method, prior to re-blessing and a new $bessie->eat method after the conversion by grind()? Am I confusing myself, or, won't there be a conflict?

mkmcconn

Replies are listed 'Best First'.
(jeffa) 3Re: normal objects?
by jeffa (Bishop) on Jan 25, 2001 at 01:23 UTC
    Yes there will be a conflict. You will need this as well:
    package Beef; use vars qw(@ISA); #if you use strict @ISA = qw(Cow);
    Which is why it's wise to plan out your inheritance tree before you start coding. OOP is only as good as its design.

    To be technical, Beef IS NOT a Cow - a Cow HAS Beef. Take a look into aggregation for alternatives to inheritance.

    Jeff

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    F--F--F--F--F--F--F--F--
    (the triplet paradiddle)
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-03-29 10:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found