I would like to discuss the advantages and disadvantages of using ORM (such as ADO.NET).
Advantages:
- Speeds-up Development – eliminates the need for repetitive SQL code.
- Reduces Development Time.
- Reduces Development Costs.
- Overcomes vendor specific SQL differences – the ORM knows how to write vendor specific SQL so you don’t have to.
Disadvantages:
- Loss in developer productivity whilst they learn to program with ORM.
- Developers lose understanding of what the code is actually doing – the developer is more in control using SQL.
- ORM has a tendency to be slow.
- ORM fail to compete against SQL queries for complex queries.
In summary, I believe that the advantages of using an ORM (mainly the reduced time taken to perform repetitive tasks) are far outweighed by the disadvantages of ORM e.g. it’s difficulty to get to grips with.
Can people point out where I am going wrong and suggest any further advantages/disadvantages.
I say, use ORM but keep this in mind.
Design your queries and write code
that will result in the least number
of roundtrips with the server. It’s
the overhead taken for the roundtrip
that takes up time.
Read about the experiences other
people have had with the selected
ORM before you dig in too deep.
Always compare your queries with the
actual ones being executed in SQL
server profiler.
Edit:
You wouldn’t use an ORM for a performance critical situation same way you wouldn’t use .Net or Java to write an operating system. Consider your requirements before choosing. Even if you don’t use an ORM, you will end up doing some mapping yourself either via repeating a lot of code or by using a data dictionary. Why not use an ORM and know how to use its options to make it ALMOST as fast? Weigh up the advantages and disadvantages and make your choice.
http://mikehadlow.blogspot.ca/2012/06/when-should-i-use-orm.html