- Spring 5 Design Patterns
- Dinesh Rajput
- 161字
- 2021-07-08 09:59:36
Implementation of the adapter design pattern in the Spring Framework
Spring Framework uses the adapter design pattern to implement a lot of functionality across the framework transparently. The following are some listed classes based on the adapter design pattern in the Spring Framework:
- JpaVendorAdapter
- HibernateJpaVendorAdapter
- HandlerInterceptorAdapter
- MessageListenerAdapter
- SpringContextResourceAdapter
- ClassPreProcessorAgentAdapter
- RequestMappingHandlerAdapter
- AnnotationMethodHandlerAdapter
- WebMvcConfigurerAdapter
The UML diagram for the adapter pattern
Let's understand the preceding UML diagram that illustrates the components of the adapter design pattern:

- The Target Interface: This is the desired interface class that will be used by the clients
- The Adapter class: This class is a wrapper class that implements the desired target interface and modifies the specific request available from the Adaptee class
- The Adaptee class: This is the class that is used by the Adapter class to reuse the existing functionalities and modify them for desired use
- Client: This class will interact with the Adapter class
Let's look at the following sample implementation of the adapter design pattern.
推薦閱讀
- MySQL數據庫管理實戰
- Java高手真經(高級編程卷):Java Web高級開發技術
- Mastering Natural Language Processing with Python
- Xcode 7 Essentials(Second Edition)
- INSTANT MinGW Starter
- ASP.NET動態網頁設計教程(第三版)
- 單片機應用技術
- CKA/CKAD應試教程:從Docker到Kubernetes完全攻略
- Building an RPG with Unity 2018
- Teaching with Google Classroom
- Android驅動開發權威指南
- Mastering jQuery Mobile
- 奔跑吧 Linux內核
- Learning Grunt
- Microsoft Exchange Server 2016 PowerShell Cookbook(Fourth Edition)