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

  • Spring 5 Design Patterns
  • Dinesh Rajput
  • 102字
  • 2021-07-08 09:59:39

Decorator design pattern in the Spring Framework

The Spring Framework uses the Decorator design pattern to build important functionalities such as transactions, cache synchronization, and security-related tasks. Let's look at some functionalities where Spring implements this pattern transparently:

  • Weaving the advice into the Spring application. It uses the Decorator pattern via the CGLib proxy. It works by generating a subclass of the target class at runtime.
  • BeanDefinitionDecorator : It is used to decorate the bean definition via applied custom attributes.
  • WebSocketHandlerDecorator: It is used to decorate a WebSocketHandler with additional behaviors.

Now let's turn to another GOF Design Pattern - Facade design pattern.

主站蜘蛛池模板: 云林县| 中山市| 英吉沙县| 论坛| 榆中县| 昌吉市| 浦东新区| 沿河| 奉新县| 富川| 郴州市| 西乌珠穆沁旗| 岳西县| 盐亭县| 伊吾县| 大洼县| 绥宁县| 华宁县| 达日县| 敖汉旗| 汤原县| 南和县| 平遥县| 吉安市| 招远市| 余姚市| 安泽县| 固阳县| 屯门区| 德江县| 当雄县| 保康县| 上犹县| 台南市| 当阳市| 西乌珠穆沁旗| 息烽县| 阳山县| 临猗县| 巴东县| 宜川县|