0

As the popularity of ORMs like LINQ to SQL and Entity Framework increases, it makes me question using native queries and stored procedures.

I am naturally geared towards SQL and the direct contact with the RDBMS. I enjoy the pure control over what happens, and I like my traces showing exactly what I'm calling in code (stored procedures, etc.).

But what are the gains of ORMs that I am missing out on? Is it just the rapid development process? The lack of necessity to administer the database and objects included?

What am I missing out on by not using EF and LINQ to SQL?

  • possible duplicate of [Code generators vs. ORMs vs. Stored Procedures](http://stackoverflow.com/questions/76395/code-generators-vs-orms-vs-stored-procedures) – Omar Oct 19 '11 at 22:22

1 Answers1

1

I think biggest impact here is productivity; it's real simple to use EF (or any other ORM) to build simple CRUD interfaces. But problems comes when you do not fully understand that's going on.

For example, lets suppose a big object, with several sub collections; ORMs have a limit do understand how that data is integrated and must return data denormalized to materialize that object. And that can be a huge impact on data transfer.

Another thing is about performance. Maybe you get an user interface which should do many calculations, or to update a big object and its dependencies. In this case, I suggest to use native access (stored procedures, etc) to unleash your RDBMS full potential.

Summary: simple interfaces, ORM; medium to complex interfaces, stored procedures.

Rubens Farias
  • 57,174
  • 8
  • 131
  • 162
  • I like your answer. It makes me comfortable knowing that my native SQL ways are sufficient in all realms. Even if I do reinvent the proverbial wheel on smaller projects, the direct control gives me peace of mind. –  Oct 19 '11 at 22:42
  • That's my approach; for every simple UI on my applications I use pure EF objects and, for n-n relationships, reports and other complex interfaces, I rely on stored procedures, eventually receiving an XML parameter for lots of data and hardcore performance/transaction consistency. – Rubens Farias Oct 19 '11 at 22:45