Decorator Pattern using the example of a cached repository
- 2/19/2022
- 7 minute read
The decorator pattern is a common pattern in object oriented languages. It allows us to add behavior to an individual object without changing the object itself.
We will exactly that with a repository. We introduce a caching layer via the decorator pattern.
