package
0.0.0-20240902082406-25d27471d586
Repository: https://github.com/hexiaopi/go-notes.git
Documentation: pkg.go.dev

# README

Decorator Pattern 装饰者模式


装饰者模式动态地将责任附加到对象上。若要扩展功能,装饰者提供了比继承更有弹性地替代方案。

  1. 找出应用中可能需要变化之处,把它们独立出来,不要和那些不需要变化的代码混在一起;
  2. 针对接口编程,而不是针对实现编程;
  3. 多用组合、少用继承;

# Functions

No description provided by the author
No description provided by the author

# Structs

AddDecorator 装饰者.
No description provided by the author
MulDecorator 装饰者.

# Interfaces

No description provided by the author