The bridge pattern
There can be situations where multiple modules of an application are being built together and changed frequently. Due to high dependency, the probability of breaking the code is prominent.
To understand this pattern, we first need to understand the problem. Assume that a web development company wants to build and launch a new web framework. To speed up the development cycle, they decide to create two teams: the Core framework and User experience (UX) team. As the name suggests the Core framework team will be responsible for designing and implementing the core of the framework and the UX team will be responsible for the user interface. Initially, it was decided that the framework will support two types of websites: Blog and Content Management System (CMS). In the same way, they decided to release two themes named White Blue and White Green.
The team came up with the following class structure at a high level:
After taking a look at this class diagram, the team understood...