3 ms·
I think micro ORMs like Dapper are a perfectly reasonable compromise between too much abstraction vs too much abstraction. Hand populating data structures from
by alkonaut 8y ago
I think micro ORMs like Dapper are a perfectly reasonable compromise between too much abstraction vs too much abstraction. Hand populating data structures from database query results is error prone and tedious. Using a “big” ORM like hibernate or EF is a leaky and expensive (over-)abstraction. Not just because they typically come with a query dsl but they also come with performance considerations and architectural consequences that are hard to predict. You end up in a situation where estimating work is hard because you don’t know if the ORM is going to play along (making a feature trivial to implement) or hit a snag (making it very time consuming). With smaller abstractions the estimates may be higher in the best case but they vary less. This is one of the most important qualities about a library or stack. Not the average, but the variance in difficulty.
On the topic of query DSL’s - the only acceptable ones are those that are native to your programming language. A good example is the F# SQL type provider. If that’s sufficient for your needs, it’s actually quite elegant as far as query languages go - and it’s all F# meaning it’s not a specific language for querying.
- tartoran 8y agoThanks for pointing out the F# SQL, I just looked it up and read this https://dev.to/kspeakman/dirt-simple-sql-queries-in-f-a37 https://dev.to/kspeakman/dirt-simple-sql-queries-in-f-a37
- jordanab 8y agoI think that the current iteration of EF is still a great fit for small to medium sized projects. Besides offering strongly typed queries (LINQ) and updates, it also provides some additional functionalities such as migrations that such projects really can benefit from.