Does it make sense to use OR-mapper?
I ask this stack overflow question because it is the best I know to find smart developers who want to give them help and opinions.
My reasoning is this:
1.) Where does SQL belong?
a.) In every professional project I have worked on, data security has been a key requirement. Stored procedures provide a natural gateway for access control and auditing.
b.) Problems with applications during production can often be resolved between tables and stored procedures without releasing new assemblies.
2.) How can I manage the created SQL? I trust parsing trees to generate efficient SQL. I have a lot of experience optimizing SQL in SQL Server and Oracle, but I wouldn’t feel cheated if I never had to do this again. :)
3.) What is the point of using OR-Mapper if I get my data from stored procedures?
I used a repository template with a public data access level. If you need to cache a collection, I cache it. I also have experience using EF on a small CRUD application and experience helping set up an NHibernate application that is experiencing performance issues. Therefore, I am a little biased, but willing to learn.
Over the past few years, we have all heard many respected developers advocating the use of specific OR-Mappers (Entity-Framework, NHibernate, etc.).
Can someone tell me why someone should go to ORM for basic development in a large project?
edit: http://www.codinghorror.com/blog/2006/06/object-relational-mapping-is-the-vietnam-of-computer-science.html seems to be actively discussing this topic, but is deprecated.
One more edit: It seems that everyone agrees that Stored Procedures should be used for large enterprise applications, because of their performance and their ability to add programming logic closer to the data.
I see that the strongest argument in favor of OR-cards is the productivity of developers.
I suspect that the big motivator for the ORM movement is the developer’s preference for residual agnosticism (without worrying about whether the data is stored in memory [other than caching] or in the database).
ORMs seem like outstanding time savings for local and small web applications.
Perhaps the best advice I see is from client09: use ORM tuning, but use stored procedures for intensive database material (AKA when ORM is insufficient).