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

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.

主站蜘蛛池模板: 黎城县| 科尔| 亚东县| 保德县| 闽侯县| 黔西县| 巨野县| 南昌市| 宁津县| 温州市| 阿图什市| 广西| 襄城县| 合阳县| 潮州市| 泰安市| 惠东县| 广灵县| 柏乡县| 枣强县| 峨山| 扎兰屯市| 洪湖市| 忻城县| 青铜峡市| 自贡市| 南和县| 斗六市| 城步| 年辖:市辖区| 恭城| 礼泉县| 桂东县| 双辽市| 连州市| 祁门县| 西和县| 宣威市| 镇江市| 安庆市| 昌邑市|