Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Encapsulation as aid to debugging

by mreece (Friar)
on Oct 06, 2006 at 22:30 UTC ( #576766=note: print w/replies, xml ) Need Help??


in reply to Encapsulation as aid to debugging
in thread Better Inside-Out Objects :)

$o->bar( 99 ); is $o->bar, 99, "can set and get value of Bar's secret"; is $o->foo, 99, "secrets of subclasses are shared";
can you explain the intent there? why should setting bar also change foo?

Replies are listed 'Best First'.
Re^2: Encapsulation as aid to debugging
by xdg (Monsignor) on Oct 07, 2006 at 12:03 UTC

    foo and bar aren't properties. They're both alias accessors to a single, private property called secret.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2019-08-25 23:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?