- 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.
推薦閱讀
- Power Up Your PowToon Studio Project
- C#完全自學教程
- Python程序設計(第3版)
- PyTorch Artificial Intelligence Fundamentals
- Learn Scala Programming
- Learning Selenium Testing Tools(Third Edition)
- PLC編程與調試技術(松下系列)
- C# Multithreaded and Parallel Programming
- Qt5 C++ GUI Programming Cookbook
- 玩轉.NET Micro Framework移植:基于STM32F10x處理器
- Java 11 and 12:New Features
- Learning Java Lambdas
- Building an E-Commerce Application with MEAN
- Yii框架深度剖析
- 接口自動化測試持續集成:Postman+Newman+Git+Jenkins+釘釘