- Which design pattern is used to get rid of too many subclasses by creating a separate class for each combination?
- What is the bridge pattern used for?
- Which design pattern defines one to many dependency among objects?
Which design pattern is used to get rid of too many subclasses by creating a separate class for each combination?
Abstract Factory Pattern
In the abstract factory pattern, we get rid of if-else block and have a factory class for each subclass and then an abstract factory class that will return the subclass based on the input factory class.
What is the bridge pattern used for?
The bridge pattern is a design pattern used in software engineering that is meant to "decouple an abstraction from its implementation so that the two can vary independently", introduced by the Gang of Four.
Which design pattern defines one to many dependency among objects?
According to the Gang of Four, the intent of the Observer pattern is to “Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.”