- 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.
推薦閱讀
- Mastering Concurrency Programming with Java 8
- HTML5移動Web開發技術
- Java應用開發與實踐
- Wireshark Network Security
- TypeScript圖形渲染實戰:基于WebGL的3D架構與實現
- 深度強化學習算法與實踐:基于PyTorch的實現
- Haxe Game Development Essentials
- INSTANT Passbook App Development for iOS How-to
- NoSQL數據庫原理
- Java網絡編程實戰
- MySQL入門很輕松(微課超值版)
- 一本書講透Java線程:原理與實踐
- 持續集成與持續交付實戰:用Jenkins、Travis CI和CircleCI構建和發布大規模高質量軟件
- MINECRAFT編程:使用Python語言玩轉我的世界
- Spring 5 Design Patterns