Mediator Pattern
The connections between UI components and related objects could be extremely complex. Object-oriented programming distributes functionalities among objects. This makes coding easier with cleaner and more intuitive logic; however, it does not ensure the reusability and sometimes makes it difficult to understand if you look at the code again after some days (you may still understand every single operation but would be confused about the interconnections if the network becomes really intricate).
Consider a page for editing user profile. There are standalone inputs like nickname and tagline, as well as inputs that are related to each other. Taking location selection for example, there could easily be a tree-level location and the options ...
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