- Spring 5 Design Patterns
- Dinesh Rajput
- 242字
- 2021-07-08 09:59:36
The Bridge design pattern
- GoF Design Patterns: Elements of Reusable Object-Oriented Software
In software engineering, one of the most popular notions is preferred composition over inheritance. Bridge design pattern promotes this popular notion. Similar to the adapter pattern, this pattern also comes under the structural design pattern family of the GoF Design Pattern. The approach of the Bridge pattern is to decouple an abstraction used by the client code from its implementation; that means it separates the abstraction and its implementation in to separate class hierarchies. And also, Bridge pattern prefers composition over inheritance because inheritance isn't always flexible and it breaks the encapsulation, so any change made in the implementer affects the abstraction used by the client code.
The bridge provides a way to communicate between two different independent components in software development, and a bridge structure provides you with a way to decouple the abstract class and the implementer class. So any change made in either the implementation class or the implementer (that is, the interface) doesn't affect the abstract class or its refined abstraction class. It makes this possible by using composition between the interface and the abstraction. Bridge pattern uses an interface as a bridge between the concrete classes of an abstract class and implementing classes of that interface. You can make changes in both types of class without any impact on the client code.
- 觸·心:DT時代的大數據精準營銷
- 數據庫程序員面試筆試真題與解析
- 薛定宇教授大講堂(卷Ⅳ):MATLAB最優化計算
- Quarkus實踐指南:構建新一代的Kubernetes原生Java微服務
- Unity 5.x By Example
- INSTANT Django 1.5 Application Development Starter
- 從0到1:Python數據分析
- Web前端應用開發技術
- FFmpeg開發實戰:從零基礎到短視頻上線
- Drupal Search Engine Optimization
- 數字媒體技術概論
- Web開發新體驗
- Python繪圖指南:分形與數據可視化(全彩)
- Building Scalable Apps with Redis and Node.js
- Python程序設計