Access to the DBMS in the old school compared to ORM (NHibernate, EF, etc.). Who is winning?

I managed to write my own SQL passcode with a combination of stored procedures and parameterized queries, as well as a small wrapper library that I wrote to minimize the ADO.NET grunge. In the past, this worked very well, and I was very productive.

I'm heading for a new project - should I put my old school materials behind me and delve into the ORM solution? (I know that there are huge differences in concepts between NHibernate and EF - I donโ€™t want to delve into this here. For the sake of argument, even a LINQ piece with the old school alternatives.) Iโ€™m looking for tips on the actual use of materials like ORM against what I know (and I know well).

Old ADO.NET or ORM code? I'm sure there is a curve - does the curve have a return on investment that makes things useful? I am worried and ready to learn, but I have a deadline.

+4
source share
3 answers

Good question, but very controversial topic.

This blog post from Frans Bouma from a few years ago, citing the benefits of dynamic SQL (meaning ORM) over stored procedures, caused a fiery fiery war.

+1
source

I found that LINQ to SQL is much faster when I prototype the code. It just discards any other method when I need something now.

But there is a cost. Compared to manual procs, LINQ is slow. Especially if you are not very careful, because seemingly minor changes can suddenly make one turn in 1 + N queries.

My recommendation. Use LINQ to SQL first, then swtich for procs if you are not getting the required performance.

+2
source

An excellent discussion on this topic took place at DevTeach in Montreal. If you go to this URL: http://www.dotnetrocks.com/default.aspx?showNum=240 , you will hear two experts in this field (Ted Neward and Oren Eini) the pros and cons of each approach. You will probably find the best answer on a topic that does not have a real definite answer.

0
source

Source: https://habr.com/ru/post/1276671/


All Articles