Chapter 4. Data Encapsulation and Value Types
In the last chapter we looked at resource encapsulation as distinct from data encapsulation. Where resource encapsulation is more about mechanism than meaning, data encapsulation can be said to be the opposite (though the distinctions do blur from case to case).
Data encapsulation provides the classic object-oriented encapsulation benefits:
Coherence of data. Object instance state can be initialized to a meaningful whole, and subsequent manipulations of the instance via its interface methods are done atomically; the instance will have consistent members before a method is called and after the method call is complete.
Reduction of complexity. Client code manipulates a straightforward public interface to ...