DEV Community

Discussion on: Keep your code dumb

Collapse
 
eriksk profile image
Erik Skoglund

I had the exact same scenario as you. C# Lazy loaded props that read from db, serialization for redis = bad.

But I think that specific problem has more to do about what you are trying to cache. Ideally you would just cache a poco-model instead and use interfaces for your models. Then you don't need to worry about that at all.

That's what I did in my case, mostly because of constraints on changing the lazy-loading.

That said; lazy loading can cause all kinds of unexpected weird problems.

Collapse
 
joelnet profile image
JavaScript Joel

The problem is so deep in the bones of the software, the company decided to just abandon the approach all together due to cost of repair.