- 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.
推薦閱讀
- Spring 5.0 By Example
- Spring Cloud Alibaba微服務架構設計與開發實戰
- Elasticsearch for Hadoop
- Gradle for Android
- Swift語言實戰精講
- 計算機應用基礎實踐教程
- 單片機C語言程序設計實訓100例
- Mastering Docker
- 愛上C語言:C KISS
- ASP.NET Web API Security Essentials
- Appcelerator Titanium:Patterns and Best Practices
- Java自然語言處理(原書第2版)
- 從零開始構建深度前饋神經網絡:Python+TensorFlow 2.x
- Mastering Responsive Web Design
- Image Processing with ImageJ(Second Edition)