- 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.
推薦閱讀
- 零起步玩轉(zhuǎn)掌控板與Mind+
- SQL學(xué)習(xí)指南(第3版)
- Building Mapping Applications with QGIS
- Jupyter數(shù)據(jù)科學(xué)實戰(zhàn)
- Scala編程實戰(zhàn)(原書第2版)
- Access 2010數(shù)據(jù)庫應(yīng)用技術(shù)(第2版)
- 深入理解C指針
- Advanced UFT 12 for Test Engineers Cookbook
- Java Web開發(fā)實例大全(基礎(chǔ)卷) (軟件工程師開發(fā)大系)
- jQuery技術(shù)內(nèi)幕:深入解析jQuery架構(gòu)設(shè)計與實現(xiàn)原理
- Android系統(tǒng)下Java編程詳解
- Scratch從入門到精通
- Learning Concurrency in Python
- Blender 3D Cookbook
- Manage Your SAP Projects with SAP Activate