- 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:

- 多媒體CAI課件設計與制作導論(第二版)
- 高效微控制器C語言編程
- Mastering matplotlib
- 從0到1:HTML+CSS快速上手
- Mastering Ubuntu Server
- FLL+WRO樂高機器人競賽教程:機械、巡線與PID
- INSTANT Django 1.5 Application Development Starter
- 從Excel到Python:用Python輕松處理Excel數(shù)據(jù)(第2版)
- SQL Server與JSP動態(tài)網(wǎng)站開發(fā)
- C#實踐教程(第2版)
- Bootstrap 4 Cookbook
- 深入理解C指針
- 智能手機故障檢測與維修從入門到精通
- Java并發(fā)編程:核心方法與框架
- Mockito Essentials