Decorating mode: Dynamically adds some additional responsibilities to an object, and the adornment mode is more flexible than generating subclasses for added functionality.
If there is only one concretecomponent class and no abstract component class, then the decorator class can be a subclass of Concretecomponent. Similarly, if there is only one Concretedecorator class, then there is no need to create a separate decorator class, and you can combine the responsibilities of decorator and Concretedecorator into a single class.
Summary: When the system needs new functionality, it is adding new code to the old class. These new codes often adorn the core responsibilities or main behaviors of the original class. They add new fields, new methods, and new logic to the main class, increasing the complexity of the main class. And these new things are just to meet the needs of some particular behavior that will only be performed in certain circumstances.
Decoration mode provides a great solution, which puts each function to be decorated in a separate class, and lets the class wrap the object it is decorating, so that when special behavior is required, the customer code can selectively and sequentially use the adornment function to wrap the object at run time.
Design Pattern---decoration mode