3 ms·
An ORM isn't necessarily complex. It just needs to map a tuple to an object. Where things get complex is when your framework starts introducing other concepts
by daigoba66 13y ago
An ORM isn't necessarily complex. It just needs to map a tuple to an object.
Where things get complex is when your framework starts introducing other concepts such as query generators, unit-of-work, caching, lazy-loading, etc.
One of the most critical features is query generation, which I think is the point of this article. Simple queries are pretty easy to abstract, such as loading rows by primary key or querying based off a simple index. Other queries, especially aggregate queries, get tricky fast. I argue that often it is much harder and more work to construct an appropriate query via your frameworks query generator.
Fortunately many good frameworks allow you to essentially write the exact SQL to be executed and the rest of the framework (mapping, caching, unit-of-work) "just works" with the results.