Encapsulation and Observability

Implementation hiding is a fundamental principle of object-oriented encapsulation. An object represents a thing as a whole. It may have characteristics or attributes, but the underlying data that represents them is not necessarily the same as the external representation. Similarly, we suppress subsets of class behaviors that do not directly manifest in the external representation, because they are one of many possible implementations or they do not make sense in isolation.

Get Quality Code: Software Testing Principles, Practices, and Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.