Use the Decorator Pattern for Repository Caching and Cache Invalidation

In Swift, naturally

Steven Curtis
6 min readFeb 9, 2023

--

Photo by Frank Sobolewski on Unsplash

I’ve an example architecture that I’ve used for a while in these tutorials and for *other* uses. I quite like it as it conforms to the solid principles (more or less).

However, there is one thing that this architecture does not handle at all. It’s using a cache. I’ve used…

--

--