G
G
garex2016-10-14 14:14:16
Design patterns
garex, 2016-10-14 14:14:16

Is cache an optional dependency?

My colleague claims that the cache cannot. an optional dependency and we should always require it as a non-zero constructor parameter on DI.
I think that the null-object pattern is quite suitable for the cache, because. it is an infrastructure and optimization layer that the user of the class can inject as problems arise.
What are your thoughts on this topic?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question