ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Create a decorator

Last modified: 11 February 2024

The Decorator design pattern is used to dynamically add additional behavior to an object. In addition, by using interfaces, a decorator can be used to unify types in a manner similar to multiple inheritance.

Let’s take an example – suppose you have two objects, called Bird and Lizard, that you want to put into a Decorator: