I am messing around with the EF4.1. I want to keep my domain and my DAL separate. My domain contains the basic entity classes and the interfaces for repositories. The DAL contains implementations of those repositories.
My issue is that I have to edit my domain to use the EF. For example, a 'Person' that has an 'Address', now has an 'AddressId' and a 'virtual Address'. I also keep annotations in my domain layer now. I'm not too happy with this since this means I'm changing the core of my application to use the EF. I'm also introducing irrelevant data since an Address doesn't need to have an ID in the context of my application; only in the database. What if tomorrow I write a new DAL layer that gets my objects from a web service or an XML file or something?
Is there a way around this? I was thinking of keeping the EF entities in the DAL layer and mapping them to my domain classes in the repositories, but wouldn't that be a huge performance hit?