Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question