Let's imagine I start to develop a project. So must I seriously care about possibility of changing ORM in future?
Or, more precisely:
Speaking practically, I'm thinking if it is valuable to dedicate significant efforts on trying to develop ORM-agnostic solutions, or not.
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With