你的位置: 码友网首页 / 资讯源列表 / Design patterns in C# - The Decorator Pattern

关于[Design patterns in C# - The Decorator Pattern]的摘要:

So, after a long break, this week I've decided to revive my series on design patterns in C#, and move on to the decorator pattern! To use the decorator pattern, you wrap an object in another object in order to extend behaviour. The objects all implement the same interface, so the decorators can stack on top of one another, extendng the behaviour further. Using this pattern, you are able to extend the behaviour of a single object, rather than extending the behaviour of a class as a whole (by e.g. using subclasses).

原文地址: https://endjin.com/blog/2020/10/design-patterns-in-csharp-the-decorator-pattern

收录时间: 2020-10-16 浏览量: 1852 分类: 设计模式

| 0 收藏 | 0