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

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

主站蜘蛛池模板: 奉节县| 卢氏县| 龙泉市| 田阳县| 扶沟县| 岚皋县| 靖安县| 松桃| 崇明县| 井陉县| 沽源县| 花垣县| 宁化县| 勃利县| 达尔| 铜鼓县| 齐河县| 万山特区| 勐海县| 巧家县| 宁武县| 翁牛特旗| 贵州省| 邹城市| 常州市| 香河县| 横山县| 屯昌县| 仲巴县| 光山县| 英德市| 浮梁县| 广丰县| 勃利县| 北辰区| 襄汾县| 安泽县| 黔西| 永安市| 深州市| 浏阳市|