14.3 Design Patterns
In OO design, you’ve learned that classes should not be tightly coupled, but instead loosely coupled. This suggestion means classes shouldn’t know too much about other classes, and interactions should be through well-defined interfaces so that classes can still be modified subsequently. Loose coupling has many advantages, including increasing reusability and making the program more change friendly.
Let’s use an example to explain these features: Customer data must be stored in a data structure. For this data source, a graphical user interface (GUI), such as an input screen, displays and manages the data. When data is entered, deleted, and changed, these changes should be transferred to the data structure. (We’ll describe ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access