views:

454

answers:

2

If the framework is persistence agnostic, can my unit tests construct a file system version of the persistance store underneath my entity model?

I'll be using the model first features of entity framework in the GUI for sure because it's too easy for my devs to make schema changes and keep DAL layer in sync.

Has anyone tried using the model first approach and adding persistence ignorance?

I think this would be my ideal modelling world. I use LINQ2SQL atm and it's a bit tricky to swap out the data store yet have an automatically rich data tier that doesn't hide behind a set of business line IDataContext interfaces.

If I can see some scenarios of this working, I'd like to invest more time in the future to try this out.

+2  A: 

Entity Framework does not have true persistence ignorance. That is one of the biggest criticisms (i.e. a forced base class, lots of EF ties, etc). LINQ-to-SQL can have persistence ignorance, but in reality people tend to use the lazy loading and attributed approach, which means that it still doesn't have persistence ignoance.

Re being persistence agnostic - it (EF) would still need a provider. Sure, if you want to write an EF provider that talks to the file system, go ahead! It would be a lot of work though. It would be easier to use a SQL Express database (flat file) etc.

Marc Gravell
+3  A: 

Just an update, this has now changed as of Entity Framework 4.0 which supports Persistence Ignorance.

aleemb