ANTI-PATTERN!
Lazy loading = lazy thinking.
This is a design (noun) in the absence of design (verb). Do you know how your entities will be used? Can you be specific about the properties that will be required? Have you got a design? If so then you don’t need lazy loading – you need each query and its result to be explicit. Does that mean hundreds of queries and models? Probably. Does that scare you? If so then you are doing something else wrong (i.e. don’t try writing that code by hand).
It is sensible to *think* of your objects as immutable. It imposes a very simple and wide-reaching limitation that instantly requires you to take a different tack. And the alternatives you come up with, even if they are still somewhat naive, *will* be better than you were aiming for previously.
Will this eventually lead you to functional programming and domain driven design? Maybe. But don’t worry about that now. You are on a journey of many steps and this is just one of them. The rest of your journey has *not* been decided yet,
Recent Comments