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

- DevOps with Kubernetes
- 零基礎(chǔ)PHP學習筆記
- Three.js開發(fā)指南:基于WebGL和HTML5在網(wǎng)頁上渲染3D圖形和動畫(原書第3版)
- Learning Flask Framework
- Vue.js 3.x從入門到精通(視頻教學版)
- Practical Windows Forensics
- QGIS:Becoming a GIS Power User
- Microsoft System Center Orchestrator 2012 R2 Essentials
- VMware虛擬化技術(shù)
- HTML5從入門到精通 (第2版)
- Getting Started with Laravel 4
- Python Web數(shù)據(jù)分析可視化:基于Django框架的開發(fā)實戰(zhàn)
- Access 2010數(shù)據(jù)庫應用技術(shù)實驗指導與習題選解(第2版)
- C語言程序設(shè)計實踐
- Java EE架構(gòu)設(shè)計與開發(fā)實踐