October 2004
Intermediate to advanced
240 pages
6h 22m
English
Don’t tell: Don’t expose internal information from an entity that provides an abstraction.
To minimize dependencies between calling code that manipulates an abstraction and the abstraction’s implementation(s), data that is internal to the implementation must be hidden. Otherwise, calling code can access—or, worse, manipulate—that information, and the intended-to-be-internal information has leaked into the abstraction on which calling code depends. Expose an abstraction (preferably a domain abstraction where available, but at least a get/set abstraction) instead of data.
Information hiding improves a project’s cost, schedule, and/or risk in two main ways:
• It localizes changes: Information hiding reduces ...
Read now
Unlock full access