开发者

Attributes are an example of Decorator?

The decorator pattern applies when there is a need to dynamically add responsibilitie开发者_运维百科s to a class, and when subclassing would be impossible due to the large number of subclasses that could result.

Given above definition I would think attributes is decorator. Or could it be considered Proxy or Adapter?

Thoughts?


Yes, .NET attributes are basically their way of implementing the decorator pattern.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜