官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 黄平县| 华亭县| 博罗县| 鹤庆县| 贡觉县| 谷城县| 铁力市| 论坛| 临洮县| 辽宁省| 泸定县| 永新县| 忻州市| 永胜县| 新沂市| 两当县| 海兴县| 栖霞市| 临夏县| 上虞市| 河南省| 赤峰市| 沭阳县| 长沙县| 鲜城| 海门市| 怀化市| 鹤壁市| 明水县| 祁阳县| 沾化县| 宁国市| 无锡市| 化德县| 富平县| 乌海市| 青海省| 喀什市| 五峰| 井冈山市| 东城区|