4 ms·
At some point for me something flipped. I YAGNI the concretion and write the abstract-as-possible version. Do I write a UserStore? That would be the simplest,
by mrkeen 4mo ago
At some point for me something flipped.
I YAGNI the concretion and write the abstract-as-possible version.
Do I write a UserStore? That would be the simplest, right? Well no, I might not need that particular formulation of a User. So I just make a Store of anything-which-is-storable.
If you're not used to it, it looks like you've over-engineered and ended up with Generics soup, but paradoxically, you're committing yourself the least to any concrete implementation.
- deleted 4mo ago[deleted]
- dpark 4mo ago> If you're not used to it, it looks like you've over-engineered and ended up with Generics soup Yes, it looks exactly like that. You’ve built not just an interface for UserStore you probably didn’t need, but a generalized Store abstraction that you definitely didn’t need. > but paradoxically, you're committing yourself the least to any concrete implementation This isn’t paradoxical at all. You’ve avoided committing yourself to a concrete implementation by implementing layers of goop you don’t need and likely never will. And because you did all this abstraction without real needs to ground it, you almost certainly did it wrong even if you do eventually need it. You are gonna need a user store, so you should have built that first.
- tpoacher 4mo agoThen again, this goes completely against the "O" in the SOLID principles (and possibly also the "D" too). Personally I prefer SOLID to YAGNI.
- deleted 4mo ago[deleted]