3 ms·
Encapsulation[0] might be the term you are looking for. Enforcing object boundaries makes it easier to reason about program behavior and enforce security guaran
by 7373737373 7y ago
Encapsulation[0] might be the term you are looking for. Enforcing object boundaries makes it easier to reason about program behavior and enforce security guarantees.
If objects can only change their own data, then all change affecting the object is either caused by the object itself, or indirectly by another when information crosses the interface the boundary presents (e.g. a message was received).
Most languages use a memory model that doesn't even have the concept of access rights, everything can potentially affect anything else. If your program has to be secure, this is a nightmare.
[0] https://en.wikipedia.org/wiki/Encapsulation_(computer_programming) https://en.wikipedia.org/wiki/Encapsulation_(computer_progra...
Also interesting:
https://en.wikipedia.org/wiki/Message_passing https://en.wikipedia.org/wiki/Message_passing
https://en.wikipedia.org/wiki/Capability-based_security https://en.wikipedia.org/wiki/Capability-based_security
https://en.wikipedia.org/wiki/Agent-based_model https://en.wikipedia.org/wiki/Agent-based_model
https://en.wikipedia.org/wiki/Actor_model https://en.wikipedia.org/wiki/Actor_model
- tresilience 7y agoThanks. I've read all links and I think I would like to see more hands-on code regarding to how this is done in the systems (like Smalltalk) itself.
- 7373737373 7y agoThere are two types of languages which use encapsulation: those who use it merely as the main syntactic model (C++, Smalltalk, Java, Python) and those who actually enforce it by managing memory access during runtime (E, Erlang). The following might be intuitive https://raw.githubusercontent.com/erights/uploaded-papers/master/ocap-virtual-env.pdf https://raw.githubusercontent.com/erights/uploaded-papers/ma...