I'm creating a new project that is following closely to the design used by this example.
http://www.toplinestrategies.com/dotneters/net/wcf-entity-framework-and-n-tier-solutions-part-2/?lang=en
I have a WPF or ASP.NET app that talks to a WCF service which then sends it to the business layer to do most of the work.
The POCO objects are generated and then that template is moved to a Model project which wi开发者_如何转开发ll allow me to access those objects in the business and data layers. My question is what purpose does the Data Access Layer provide in this situation? It seems to be only holding the .edmx files.
Is this standard practice, or would I get better efficiency by simply putting the .edmx files into the Business Layer?
DAL generally provides with mapping between models and database tables. According to your description, you moved the mapping part into models. I am not sure that's a good practice though. As database table, for example, changes you need to change/build model project as well. What if you decide later to use NHibernate instead of EF? For these reasons, I think the mapping should be in DAL and DAL can be a separate project.
精彩评论