- 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.
推薦閱讀
- Cocos2d Cross-Platform Game Development Cookbook(Second Edition)
- 一步一步學Spring Boot 2:微服務項目實戰
- 深度實踐OpenStack:基于Python的OpenStack組件開發
- MySQL 8從入門到精通(視頻教學版)
- Python零基礎快樂學習之旅(K12實戰訓練)
- Effective Python Penetration Testing
- Modern JavaScript Applications
- H5頁面設計:Mugeda版(微課版)
- 微信小程序入門指南
- RabbitMQ Essentials
- Windows內核編程
- PLC應用技術(三菱FX2N系列)
- Spring Boot+MVC實戰指南
- Hands-On Nuxt.js Web Development
- C指針原理揭秘:基于底層實現機制