5 ms·
> Instafail if you use mappings (eg ORM), observer/listener, factories, singletons. Wait, why?
by computerex 10y ago
> Instafail if you use mappings (eg ORM), observer/listener, factories, singletons.
Wait, why?
- 0x445442 10y agoWhat I've seen many times with ORM tools is blind interaction with the in-memory object graph abstraction over the data store which results in many un-needed queries. It's like the option of making one DB query which returns a flat result set isn't even on the radar. As far as I can tell Factories have been replaced with DI frameworks or just hand rolled DI. Singletons aren't so bad if you're working with an object oriented language and the singleton is just an instance of a service which holds no state and has methods that operate on a limited number of data types. At that point it's essentially just a namespace for a functional library. Observer/Listeners ... Not sure here unless the commenter is advocating message queues or eventing.