Wednesday, February 26, 2014

.Net Entity Framework and DAL

This old post demonstrates some very interesting thoughts about DAL and Entity Framework, and discussed the design pattern (pros and cons) in an architecture point of view. At the last of this post, a ppt is embedded. http://www.wadewegner.com/2009/06/architecting-your-data-access-layer-with-the-entity-framework/
Here are some highlights and my understanding:
·         Use EF as DAL  This is still a good option to replace the CRUD. See my OpsLog comments below about EF.
·         Full Encapsulation of the Entity Framework.  This is the ideal solution but we probably won’t get to the complexity. It reduces coupling and make application testable.
·         Partial Encapsulation of the Entity Framework.  The author didn’t give an example, but I have some in EGMAN.  EGMAN uses MVC and MVVM (MVVM Model-View ViewModel is similar to MVC, Model-View Controller).  I used EF to map db to model (M in MVC), but sometimes lost the flexibility to add custom attribute and data access logic. I adopted MVVM, which use VM to replace C, and VM is the encapsulation of EF that extract data from the Model. 

324 comments:

«Oldest   ‹Older   601 – 324 of 324
«Oldest ‹Older   601 – 324 of 324   Newer› Newest»