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

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.

主站蜘蛛池模板: 乡宁县| 延安市| 同心县| 阜阳市| 信阳市| 云霄县| 金昌市| 禄丰县| 汶川县| 陆良县| 通化县| 儋州市| 平南县| 凌云县| 建湖县| 康马县| 如皋市| 九台市| 田东县| 苗栗县| 阿尔山市| 双流县| 武隆县| 吉林市| 红安县| 上林县| 资阳市| 新乐市| 玉树县| 平塘县| 安丘市| 阿拉善左旗| 柳江县| 万州区| 仙游县| 南召县| 双鸭山市| 大渡口区| 兴业县| 定陶县| 尼木县|