Tutorial by Examples

Definition of Decorator as per Wikiepdia: The Decorator pattern can be used to extend (decorate) the functionality of a certain object statically, or in some cases at run-time, independently of other instances of the same class, provided some groundwork is done at design time. Decorator attach add...
This example demonstrate how to add caching capabilities to DbProductRepository using Decorator pattern. This approach adheres to SOLID principles because it allows you to add caching without violating Single responsibility principle or Open/closed principle. public interface IProductRepository { ...

Page 1 of 1