Abstract
The code for creating, reading, updating and deleting (CRUD) operations based on ADO.Net Entity Framework (EF) was similar, mixed with business logic (BL) and distracted developers’ concentration from BL. This paper proposed a unified design and implementation (UDI) for CRUD based on EF to avoid above problems. Through Generics, Reflection and Lambda expression tree, the repetitive code was reduced. It was found that internal CRUD procedure was definite and external entity’s BL was changeable. So Inversion of Control (IoC) pattern which enabled the BL separating with persisting code was applied. The paper took the MVCMusicStore as an example to apply UDI. The modified example ran as well as the original one. Then the applying results were discussed. Finally, it was concluded that UDI for CRUD based on EF was useful to avoid repetitive code, reduce the mixture of BL code with CRUD and help the developers concentrate on BL.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Blakeley, J.A., Campbell, D., Muralidhar, S., Nori, A.: The ADO.NET Entity Framework: Making the Conceptual Level Real. SIGMOD Record 35(4), 31–38 (2006)
Chsword: EfSearchModel Demo (2011), http://searchmodel.codeplex.com/
Galloway, J.: ASP.NET MVC Music Store Tutorial, Version 1.0 (2010), http://mvcmusicstore.codeplex.com/releases/view/53639
Microsoft: Introduction to Generics (C# Programming Guide), http://social.msdn.microsoft.com/search/en-us?query=Generics
Microsoft: Reflection Overview, http://msdn.microsoft.com/en-us/library/f7ykdhsyv=vs.80.aspx
Microsoft: Use Expression Trees to Build Dynamic Queries, http://msdn.microsoft.com/en-us/library/bb882637.aspx
Wikipedia: Inversion of control, http://en.wikipedia.org/wiki/Inversion_of_control
Fakhroutdinov, K.: Online Shopping UML Examples, http://www.uml-diagrams.org/examples/online-shopping-example.html
Efdesign: Customizing Entity Classes in VS 2010 (2009), http://blogs.msdn.com/b/efdesign/archive/2009/01/22/customizing-entity-classes-with-t4.aspx
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Yang, X., Shen, H. (2012). A Unified Design and Implementation for Creating, Reading, Updating and Deleting Operations Based on ADO.NET Entity Framework. In: Zhao, M., Sha, J. (eds) Communications and Information Processing. Communications in Computer and Information Science, vol 289. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-31968-6_11
Download citation
DOI: https://doi.org/10.1007/978-3-642-31968-6_11
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-31967-9
Online ISBN: 978-3-642-31968-6
eBook Packages: Computer ScienceComputer Science (R0)