- 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.
推薦閱讀
- Spring 5.0 Microservices(Second Edition)
- Instant Zepto.js
- Mastering Python High Performance
- Modern JavaScript Applications
- 從Excel到Python:用Python輕松處理Excel數據(第2版)
- 程序設計基礎教程:C語言
- TMS320LF240x芯片原理、設計及應用
- 搞定J2EE:Struts+Spring+Hibernate整合詳解與典型案例
- 深入實踐DDD:以DSL驅動復雜軟件開發
- Python Digital Forensics Cookbook
- 數字媒體技術概論
- Python數據預處理技術與實踐
- Microsoft Dynamics GP 2013 Cookbook
- C語言從入門到精通(視頻實戰版)
- Java核心技術速學版(第3版)