Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)

4,676 views

Published on

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,676
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)

  1. 1. EF in the Enterprise:Architecting the Data LayerJulie Lermanthedatafarm.com@julielermanBoston Code Camp March 2013
  2. 2. Julie Lerman consultant/mentor Microsoft MVP, INETA Speaker, ASPInsider, MCP, VTdotNET Leader contact jlerman@theDataFarm.com www.thedatafarm.com blog theDataFarm.com/blog twitter @julielermanJulie Lerman, Boston Code Camp March 2013 book web site LearnEntityFramework.com
  3. 3. My (best laid) planWhere EF fits into your architectureRepository Pattern(s)Benefits of a Unit of WorkBounded DbContext for small modelsUnit Testing with Entity FrameworkJulie Lerman, Boston Code Camp March 2013
  4. 4. Demo WareJulie Lerman, Boston Code Camp March 2013
  5. 5. UI Logic LINQ DatabaseJulie Lerman, Boston Code Camp March 2013
  6. 6. Separation of Concerns Extensible Adaptable Sensible Testable MaintainableJulie Lerman, Boston Code Camp March 2013
  7. 7. UI Service Layer Bus LayerTests Repository/Unit of Work LINQTests Data Layer EF Database Julie Lerman, Boston Code Camp March 2013
  8. 8. Considering the domain Typical Model/DbContextJulie Lerman, Boston Code Camp March 2013
  9. 9. “bounded context” Delimits the applicability of a particular model. BOUNDING CONTEXTS gives team members a clear and shared understanding of what has to be consistent and what can develop independently.Julie Lerman, Boston Code Camp March 2013
  10. 10. Focused DbContextsJulie Lerman, Boston Code Camp March 2013 DB DB
  11. 11. Focused DbContextJulie Lerman, Boston Code Camp March 2013 DB DB
  12. 12. Repository Essential: Encapsulate Redundant Data Access CodeJulie Lerman, Boston Code Camp March 2013
  13. 13. UI Service Layer Bus LayerTests Repository/Unit of Work LINQTests Data Layer EF Database Julie Lerman, Boston Code Camp March 2013
  14. 14. Basic Repository Get Remove Store SendJulie Lerman, Boston Code Camp March 2013 to DB
  15. 15. Many variations… One repo One repo per per type? object graph? Read repos? Write One repo repos? per context?Julie Lerman, Boston Code Camp March 2013
  16. 16. Get Get Re move Store Remove Store Send to DB Send to DB Get Customer Rem Store Aggregate Orders ove Root Send to DBJulie Lerman, Boston Code Camp March 2013 Addresses
  17. 17. Testing with EF in the Mix Integration/ •EF only or Database? Interaction •Using database: Tests DropCreateDatabaseAlways •No EF involved: Inconsequential Unit Tests •EF in the way: Abstraction/InterfacesJulie Lerman, Boston Code Camp March 2013
  18. 18. Testability Classes System.DataFake .EntityDbSet Fake Fake Context & DataA Metadata & Context & Data B DbContexts TestsJulie Lerman, Boston Code Camp March 2013 Unit of Work UI
  19. 19. Julie Lerman consultant/mentor Microsoft MVP, INETA Speaker, ASPInsider, MCP, VTdotNET Leader contact jlerman@theDataFarm.com www.thedatafarm.com blog theDataFarm.com/blog twitter @julielermanJulie Lerman, Boston Code Camp March 2013 book web site LearnEntityFramework.com
  20. 20. Julie Lerman, Boston Code Camp March 2013
  21. 21. Resources  Pluralsight On-Demand Training: pluralsight.com  MSDN Developer Center: msdn.com/data/ef  EF Team: blogs.msdn.com/adonet  LearnEntityFramework.com  Programming Entity Framework: DbContext  by Julie Lerman and Rowan Miller, O’Reilly Media, Feb 22 2012  Domain Driven Design  By Eric Evans, Addison-Wesley, 2004  http://domaindrivendesign.org/  “Implementing Domain Driven Design”, Vaughn Vernon, 2013  Separation of ConcernsJulie Lerman, Boston Code Camp March 2013

×