Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: May Thy Closures Be Blessed

by Abigail-II (Bishop)
on Apr 27, 2004 at 07:58 UTC ( #348414=note: print w/replies, xml ) Need Help??


in reply to Re: Re^3: May Thy Closures Be Blessed
in thread May Thy Closures Be Blessed

Deliberate trespass in your own codebase isn't something you fix in software, it's something you fix by going over to someone's cube and removing their mouse balls until they get the point.
I knew there was a reason I prefer optical mice.
Anyhow, if you can't trust your fellow coders to not play symbol table / reflection / etc type games, you have problems!
Well, preventing deliberate tresspassing can be an issue - if you run code of untrusted people. Don't think that never happens - it happens all the time. You don't want that processes can change their UIDs to anything they like, do you? ;-). Granted, Unix processes aren't very object like. Another example: MUDs runs code written by many untrusted contributors, sometimes hundreds or even thousands, who can subclass almost any object. A MUD would break down if there was no way to prevent deliberate tresspassing.
Furthermore, encapsulation can be broken with no access to variables, by virtue of having trivial getter/setter methods encapsulation IS broken, because the parameters of your object can be tweaked without asking the object nicely.
This I don't understand. How does that break encapsulation? The fact there are getter/setter methods means they are part of the API. Calling a setter method is asking the object nicely (and it's up to the object to refuse).

Abigail

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2020-09-20 21:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (122 votes). Check out past polls.

    Notices?