3 ms·
It remains a good approach, even in your scenario - because that perf problem is solved using a temporal cache.
by Spearchucker 9y ago
It remains a good approach, even in your scenario - because that perf problem is solved using a temporal cache.
- barrkel 9y agoCaches are an excellent way to introduce path-dependent, time-sensitive bugs.
- Spearchucker 9y agoThe safest, most bug-free code is no code at all.
- mariusmg 9y agoI see it now ..... A interface to define the validation aspect. 3 separate implementations of said interface : 1 for db lookup, 1 for cache lookup and last for unit tests. 1 factory method which return the instance to use depending of context. Another temporal cache that holds the instance of said interface (after all, you can never have enough caches). And all of a sudden, validating some single shit takes +300 lines of code (plus tests). Welcome to enterprise , clean, better designed, greatly arhitected software everyone....
- Spearchucker 9y agoWhy do an interface at all? Is the validation definitely being shared across business functions?