Last post Jul 18, 2011 04:49 PM by atconway
Jul 14, 2011 12:23 PM|hetnet|LINK
I was wondering what would be the best approach in an ASP.NET (Web Forms) application, which has a business layer and also uses the Entity Framework for Data Access.
Would you use the Entities generated by the EF (based on the database) as business objects which could end up in the presentation layer and be displayed there? Or would you create "custom" business objects manually in a seperate business layer; entities
from DAL are first converted to related business objects in the business layer, which then go to the presentation layer?
Jul 14, 2011 01:18 PM|princeG|LINK
Please read here:http://msdn.microsoft.com/en-us/library/cc716789.aspx
Jul 18, 2011 04:49 PM|atconway|LINK
I think the problem with using the generated EF Entity classes all the way up through the layers is that you are too tightly coupled to the actual database design reflected by your entities. I would recommend working with an abstracted layer atop of the
entities that maps your objects to the EF entities to reduce underlying database changes (as much as possible), and to make more meaningful business objects without the bloat of all database fields. Some changes will have a ripple effect too great to resist
changes, but at least with your own layer you can isolate and prevent the changes from impacting the overall design as much as possible.
The last part of this
thread below also speaks briefly on this stating: "There is another layer on top of the EDM model known as the object layer, where entities are materialized as EDM-mapped objects. "