Добавить
Уведомления

Adapter and Bridge Design Patterns

- Bridge is used when we need to decouple an abstraction from its implementation so that the two can vary independently. This type of design pattern comes under structural pattern as this pattern decouples implementation class and abstract class by providing a bridge structure between them. - IMPORTANT: Keep in mind not to violate the single responsibility principle when you apply the bridge patten, which happens when you inject the implementation object inside the abstraction object, (Ex: having a save function inside the entity object)

12+
16 просмотров
2 года назад
12+
16 просмотров
2 года назад

- Bridge is used when we need to decouple an abstraction from its implementation so that the two can vary independently. This type of design pattern comes under structural pattern as this pattern decouples implementation class and abstract class by providing a bridge structure between them. - IMPORTANT: Keep in mind not to violate the single responsibility principle when you apply the bridge patten, which happens when you inject the implementation object inside the abstraction object, (Ex: having a save function inside the entity object)

, чтобы оставлять комментарии