Blog

Persistence Ignorance

March 15, 2007

The blogosphere is full with posts about how the ADO.NET Entity Framework is violating Persistence Ignorance by letting domain classes inherit from an abstract base class in order to be persisted. In addition, you have to put attributes on the properties of your class. Besides that you also need to have three mapping files. You can find more info in the following posts:

This is what I believe a huge mistake made by the ADO.NET team. They should provide a mechanism that has enough with the three mapping files. Besides that, it should be possible to use an abstract base class (or interface) and attributes on properties, without the mapping files. This for the people who don't care about Persistence Ignorance. For those who want to keep their domain model free from all kinds of data dependencies (like me) would like to have mapping files only.

I think that Microsoft is going to have a hard time keeping up with NHibernate. NHibernate is already providing these two mechanisms separately. Please let them change their mind before RTM! 

If you and your team want to learn more about how to write maintainable unit tests and get the most out of TDD practices, make sure to have look at our trainings and workshops or check out the books section. Feel free to reach out at infonull@nullprincipal-itnull.be.

Profile picture of Jan Van Ryswyck

Jan Van Ryswyck

Thank you for visiting my blog. I’m a professional software developer since Y2K. A blogger since Y2K+5. Provider of training and coaching in XP practices. Curator of the Awesome Talks list. Past organizer of the European Virtual ALT.NET meetings. Thinking and learning about all kinds of technologies since forever.

Comments

About

Thank you for visiting my website. I’m a professional software developer since Y2K. A blogger since Y2K+5. Author of Writing Maintainable Unit Tests. Provider of training and coaching in XP practices. Curator of the Awesome Talks list. Thinking and learning about all kinds of technologies since forever.

Contact information

(+32) 496 38 00 82

infonull@nullprincipal-itnull.be