4 ms·
If one is commanding an object to set a private data field which one somehow knows the name of, then it's not an object that is being dealt with, just a procedu
by frou_dh 9y ago
If one is commanding an object to set a private data field which one somehow knows the name of, then it's not an object that is being dealt with, just a procedural programming data bag.
Setter methods are 95% the same as direct mutation of encapsulated state. It degrades the concept of objects being smart independent entities.
- spdionis 9y agoGetters/setters vs public properties has nothing to do with encapsulation. Obviously not all properties are public/have getters and setters.
- frou_dh 9y agoI didn't mention getters at all. I agree that encapsulation status remains constant in the presence of either setter methods or direct mutation, i.e. broken.
- rhapsodic 9y ago> It degrades the concept of objects being smart independent entities. "Smart independent entities"? That's a new one on me. What does that mean?
- frou_dh 9y agoAn object graph operating more like a network of tiny special-purpose computers with I/O (messages/method-calls). Rather than occupants that are conscious of being not much more than rectangles in a single memoryspace. Alan Kay also made analogies with cell biology.