I am learning ASP.NET MVC now a days and I have found that most of the examples in ASP.NET MVC are with ORM. I don’t have any issue in using ORM for my learning and personal project. But at my work we have worked only with ASP.NET web forms and we use stored procedures only. We have data access layer (simple c# classes) as interface between asp.net code behind page and stored procedures. Now if we want to use ASP.NET MVC, will it be a bad idea to do it without an ORM. As most of the MVC frameworks like rails/django have built-in ORMs, is it any harm to use our own data access layer with ASP.NET MVC. I don’t want to have any database related activity like datareader, datatable in my controllers. Is there any other better solution?
Share
If you have a DAL already built – use it! Unless you were planning on moving from your existing DAL to an OR/M anyhow you won’t find it beneficial to move to an OR/M for it’s own sake.
One of the beautiful things about the MVC pattern is the is encourages a separation of concerns. This means that you are reducing coupling in you application which makes your application’s architecture flexible and modular. This means that if at some point you want to swap out your existing DAL for a more modern OR/M solution you can do so with minimum impact to your application.