
装饰器模式
具体代码见LocalDemo之shejimoshi
模块
装饰器模式(Decorator Pattern) 也称为包装模式(Wrapper Pattern) 是指在不改变原有对象的基础之上,将功能附加到对象上,提供了比继承更有弹性的替代方案(扩展原有对象的功能),属于结构型模式。装饰器模式的核心是功能扩展,使用装饰器模式可以透明且动态地扩展类的功能。
可参考博客:
()[https://blog.csdn.net/weixin_45538589/article/details/120808658]
- Title: 装饰器模式
- Author: viEcho
- Created at : 2024-01-10 00:00:00
- Updated at : 2025-02-21 18:23:21
- Link: https://viecho.github.io/2024/0110/decorator-mode.html
- License: This work is licensed under CC BY-NC-SA 4.0.
推荐阅读
Comments