ZiggyCreatures / FusionCache

FusionCache is an easy to use, fast and robust hybrid cache with advanced resiliency features.
MIT License
1.65k stars 87 forks source link

[FEATURE] 😶 More Null Object Pattern support #159

Closed jodydonetti closed 1 year ago

jodydonetti commented 1 year ago

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:

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:

which will go along the existing NullFusionCache.

jodydonetti commented 1 year ago

Hi all, v0.23.0 has been released with all of the above included 🎉