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.
精彩评论