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

  • 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.

主站蜘蛛池模板: 姜堰市| 昌宁县| 镇平县| 三都| 乌拉特后旗| 佛冈县| 图木舒克市| 中卫市| 雷州市| 泌阳县| 永康市| 阳高县| 容城县| 怀仁县| 广宗县| 通渭县| 南岸区| 淅川县| 阿城市| 阿荣旗| 长武县| 漳州市| 镇雄县| 新乐市| 昭通市| 五家渠市| 武定县| 清苑县| 大兴区| 肥城市| 科技| 隆德县| 河津市| 德昌县| 勐海县| 孝义市| 琼结县| 清水河县| 衡山县| 会宁县| 尖扎县|