- Spring 5 Design Patterns
- Dinesh Rajput
- 224字
- 2021-07-08 09:59:38
Decorator design pattern
- GOF Design Pattern
In software engineering, the common intent of all GOF structural patterns is to simplify the complex relationship between objects and classes in a flexible enterprise application. The decorator pattern is a special type of design pattern among these that comes under the structural design pattern, which allows you to add and remove behaviors for an individual object at runtime dynamically or statically, without changing the existing behavior of other associated objects from the same class. This design pattern does this without violating the Single Responsibility Principle or the SOLID principle of object-oriented programming.
This design pattern uses the compositions over the inheritance for objects associations; it allows you to divide the functionality into different concrete classes with a unique area of concern.
Benefits of the Decorator design pattern
- This pattern allows you to extend functionality dynamically and statically without altering the structure of existing objects
- By using this pattern, you could add a new responsibility to an object dynamically
- This pattern is also known as Wrapper
- This pattern uses the compositions for object relationships to maintain SOLID principles
- This pattern simplifies coding by writing new classes for every new specific functionality rather than changing the existing code of your application
- The Data Visualization Workshop
- PhoneGap:Beginner's Guide(Third Edition)
- Linux:Embedded Development
- Android開發:從0到1 (清華開發者書庫)
- 持續集成與持續交付實戰:用Jenkins、Travis CI和CircleCI構建和發布大規模高質量軟件
- 精通MySQL 8(視頻教學版)
- 運維前線:一線運維專家的運維方法、技巧與實踐
- OpenCV with Python Blueprints
- Python函數式編程(第2版)
- Python應用與實戰
- Using Yocto Project with BeagleBone Black
- Learning D3.js 5 Mapping(Second Edition)
- Java Web應用開發
- Unreal Engine Game Development Cookbook
- Swift iOS Programming for Kids