Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: A new take on affordance.

by dsheroh (Parson)
on May 18, 2002 at 14:27 UTC ( #167508=note: print w/ replies, xml ) Need Help??


in reply to Re: A new take on affordance.
in thread A new take on affordance.

A quick flip through the Camel didn't turn up anything on making truly private data, but the Coriolis Perl Black Book goes into a few tricks with closures to make your private data hard to get at. The ultimate point, though, was that anyone who knows which trick you used to hide the data can still get at it by throwing the right string of puctuation at your object.


Comment on Re: Re: A new take on affordance.
Re: Re: Re: A new take on affordance.
by Dog and Pony (Priest) on May 18, 2002 at 14:38 UTC
    In the third edition of the Camel book, it is to be found on page 339, Using Closures for Private Objects in chapter 12, Objects.

    I didn't personally look into it, but the authors of that book seems to think this method is a bit more secure than that...

    Perl offers low-level building blocks that you can use to surround your class and its objects with an impenetrable privacy shield - one stronger, in fact, than that found in many popular object-oriented languages.
    and
    This is a very strong from of encapsulation; not only is it proof against external tampering, even other methods in the same class must use the proper access methods...
    What they are talking about is using a closure as the object itself, and they proceed to give some examples. Like I said, I didn't investigate, so those claims will have to stand for the authors themselves... *grin*. I'd say they should know, though. :)


    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2014-10-24 12:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (131 votes), past polls