In FusionCache v0.22.0 the NullFusionCache has been introduced, which is an implementation of the Null Object Pattern.
Currently there are no such implementations for:
serializer (IFusionCacheSerializer)
distributed cache (IDistributedCache)
backplane (IFusionCacheBackplane)
plugin (IFusionCachePlugin)
Also, we should create a separate namespace (ZiggyCreatures.Caching.Fusion.NullObjects) specific for this, so that the root namespace will not be polluted with these classes that are useful only in some minor an very specific situations.
Finally, the existing NullFusionCache will be moved there (this is a breaking change, but needed).
Solution
Create such implementations, such that they simply do nothing and, when they have to return something, they simply return a default value.
Problem
In FusionCache v0.22.0 the
NullFusionCache
has been introduced, which is an implementation of the Null Object Pattern.Currently there are no such implementations for:
IFusionCacheSerializer
)IDistributedCache
)IFusionCacheBackplane
)IFusionCachePlugin
)Also, we should create a separate namespace (
ZiggyCreatures.Caching.Fusion.NullObjects
) specific for this, so that the root namespace will not be polluted with these classes that are useful only in some minor an very specific situations.Finally, the existing
NullFusionCache
will be moved there (this is a breaking change, but needed).Solution
Create such implementations, such that they simply do nothing and, when they have to return something, they simply return a default value.
The new implementations will be:
NullSerializer
NullDistributedCache
NullBackplane
NullPlugin
which will go along the existing
NullFusionCache
.