- Spring 5 Design Patterns
- Dinesh Rajput
- 150字
- 2021-07-08 09:59:35
The adapter design pattern
-GoF Design Patterns: Elements of Reusable Object-Oriented Software
Adapter design patterns come under the structural design pattern, according to this design pattern two incompatible classes work together that couldn't otherwise because of incompatible interfaces. This pattern works as a bridge between two incompatible interfaces. This pattern is used when two inferences of the application are incompatible in their functionalities, but these functionalities need to be integrated as a business requirement.
There are many real-life examples where we can use the adapter pattern. Suppose you have different types of electric plugs such as cylindrical and rectangular plugs, as shown in the following figure. You can use an adapter in between to fit a rectangular plug in a cylindrical socket assuming voltage requirements are met:

- The Complete Rust Programming Reference Guide
- Learning Apex Programming
- 大學(xué)計(jì)算機(jī)基礎(chǔ)實(shí)驗(yàn)教程
- Xcode 7 Essentials(Second Edition)
- JavaScript從入門到精通(第3版)
- Python面向?qū)ο缶幊蹋簶?gòu)建游戲和GUI
- The HTML and CSS Workshop
- Python完全自學(xué)教程
- 匯編語言編程基礎(chǔ):基于LoongArch
- Elasticsearch Essentials
- Python趣味編程與精彩實(shí)例
- Android Sensor Programming By Example
- Node.js區(qū)塊鏈開發(fā)
- Android技術(shù)內(nèi)幕(系統(tǒng)卷)
- C++面向?qū)ο蟪绦蛟O(shè)計(jì)