Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Must developers care about possibility of changing ORM in future?

Tags:

.net

orm

Let's imagine I start to develop a project. So must I seriously care about possibility of changing ORM in future?

Or, more precisely:

  1. Would you like to change the ORM you use in your current project to some different one. If yes, what are the reasons?
  2. Have you ever practically did this? If so, what were the reasons?

Speaking practically, I'm thinking if it is valuable to dedicate significant efforts on trying to develop ORM-agnostic solutions, or not.

like image 565
Alex Yakunin Avatar asked Dec 24 '09 06:12

Alex Yakunin


1 Answers

The odds of changing your ORM during the course of the project are pretty low. There is a very good chance that any effort you make to ensure that you can switch your ORM will be wasted in the end. You have to weigh up the the slight possibility of changing the ORM against the extra effort to make it possible to change the ORM.

To answer your questions:

  1. No
  2. Usually you would change your ORM if there is some substantial need not being met by the tool your are using. I can't really think of any example where this would make sense tho - usually you can get around any issues like these.

At the end of the day I would simply make sure that I choose an ORM that will work for me (can't really go wrong with something like NHibernate) and make sure your code is loosely coupled which should ensure that your data access code is isolated. This is good not only from a maintainability perspective, but also for testability.

like image 117
Jaco Pretorius Avatar answered Oct 03 '22 02:10

Jaco Pretorius