Presentation is loading. Please wait.

Presentation is loading. Please wait.

TechEd 2013 1/17/2019 6:32 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.

Similar presentations


Presentation on theme: "TechEd 2013 1/17/2019 6:32 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks."— Presentation transcript:

1 TechEd 2013 1/17/2019 6:32 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2 EF in Core Business Apps & Domain-Driven Design Approaches
1/17/2019 6:32 PM DEV-B336 EF in Core Business Apps & Domain-Driven Design Approaches Julie Lerman © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

3 Julie Lerman consultant/mentor contact blog book web site
Microsoft MVP, INETA Speaker, ASPInsider, MCP, VTdotNET Leader contact blog theDataFarm.com/blog twitter @julielerman book web site LearnEntityFramework.com

4 Goals EF in your Architecture DDD Bounded Context Entities &
Aggregates Repository Pattern(s) & Unit of Work

5 UI & some Logic Business Logic LINQ Data Access Database

6 Separation of Concerns
Extensible Adaptable Testable Maintainable Sensible!

7 UI Entity Framework Database Service Layer Business/Domain Layer
Repository/Unit of Work Infrastructure/Data Access Entity Framework Tests Tests LINQ Database

8 Considering Context

9 The “We Sell Stuff” Domain
Entity Framework DbContext Sales Customers Orders Products Returns Shipments Promotions Payments Shippers Employees SalesPeople SalaryHistory

10 “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. - Domain Driven Design, Eric Evans 2003

11 - Domain Driven Design, Eric Evans 2003

12 Bounded Contexts within a Domain
Billing Sales Customer Service Shipping Marketing Returns Human Resources

13 Bounded Contexts within a Domain
Billing Sales Order Customer Service Customer Service Order Shipping Customer Customers Customer Items Shippers Payments SalesPerson SalesPeople Customer Order Credit Addresses ShipAddress Shipments ContactHistory Marketing Returns Customer Promotion Order Human Resources Items Customers Employee Customer Communications SalaryHistory RMA

14 Bounded Contexts within a Domain
Billing Sales Invoice Customer Service Customer Service Order Shipping Payee Customers Customer ItemsOrdered Shippers Payments SalesPerson SalesPeople Purchaser ItemsToShip Credit Addresses ShipAddress “Ubiquitous Language” Shipments ContactHistory Marketing Returns Recipient Promotion ItemReturned Human Resources Order Contacts Employee Customer Communications SalaryHistory RMA

15 Entities, Value Objects, Aggregates & Roots

16 Aggregate : Graph of Objects
“Parent” Entity Aggregate Root Collection<EntityA> EntityA EntityA EntityA Entity B

17 Aggregates & Aggregate Roots
The Purchase Customer Order Stuff I Want ID

18 Sometimes . . . All You Need Is CRUD

19 So . . . What about those mappings? Aggregate Roots Value Objects

20 Can EF Handle Your Domain?
Invoice Payee Domain Model Payments Invoice Credit Payee Domain Model Payments Payments DB Mappings, DB concerns, Follow EF rules Persistence Model Customers Credit Invoices Credits Entity Framework/Queries/Commands Legacy Database New Database

21 Repository & Unit of Work

22 Repository Essential:
“Encapsulate Redundant Data Access Code”

23 UI Entity Framework Database Service Layer Business/Domain Layer
Repository/Unit of Work Infrastructure/Data Access Entity Framework Tests Tests LINQ Database

24 Basic Repository Get Store Remove Persist GetOrderById GetAllOrders
GetCurrentOrders GetCachedOrders GetOrdersForCustomer GetOrdersForProduct RemoveOrder Remove AddOrder Persist

25 Many variations… One repo per aggregate? One repo per type?
Read repos? Write repos? One repo per context?

26 Order Items Customer Orders
Address Repo Get Store Send to DB Re move Order Repo Get Store Send to DB Remove DbContext DbContext Customer Repo Get Store Send to DB Remove Customer Orders Addresses Aggregate Root DbContext

27 Summary Save database concerns for *later*
1/17/2019 6:32 PM Summary Save database concerns for *later* Bounding contexts reduces complexity Sometimes CRUD is all you need Use Aggregate Roots to manage graph objects Repositories are a gateway to your data Aiming for Testability can Aid in Separating Concerns © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

28 Summary Pluralsight On-Demand Training: JulieL.me/PS-Videos
1/17/2019 6:32 PM Summary Pluralsight On-Demand Training: JulieL.me/PS-Videos 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 “Domain Driven Design” Eric Evans, Addison-Wesley, 2003 “Implementing Domain Driven Design”, Vaughn Vernon, 2013 “N-Layered Domain-Oriented Architecture Guide with .NET 4.0” by César de la Torre, Unai Zorrilla, Javier Calvarro and Miguel Ángel Ramos (May 20, 2011) domaindrivendesign.org “Separation of Concerns”, MSDN Magazine, © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

29 Julie Lerman consultant/mentor contact blog book web site
Microsoft MVP, INETA Speaker, ASPInsider, MCP, VTdotNET Leader contact blog theDataFarm.com/blog twitter @julielerman book web site LearnEntityFramework.com

30 1/17/2019 6:32 PM Related content Positioning MS Dev Techs for Custom App Development (DEVB204) Cesar de la Torre Developing Core Business Apps with DDD and .NET (DEV-B311) Jimmy Nilsson Real Experiences & Architectural DDD Patterns Applied on .NET (DEV-B343) Per Rovegård Entity Framework in Core Business Apps & DDD Approaches (DEV-B336) Julie Lerman TODAY .NET Event Driven Applications, CQRS & Event-Sourcing in Mission-Critical Apps (DEVB401) June :15AM-11:30AM Greg Young Understanding Dependency Injection and Those Pesky Containers (DEVB207) June :45PM-4:00PM Miguel Castro © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

31 Resources Learning TechNet msdn http://channel9.msdn.com/Events/TechEd
1/17/2019 6:32 PM Resources Learning Sessions on Demand Microsoft Certification & Training Resources TechNet msdn Resources for IT Professionals Resources for Developers © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

32 Evaluate this session Scan this QR code to evaluate this session.
1/17/2019 6:32 PM Required Slide *delete this box when your slide is finalized Your MS Tag will be inserted here during the final scrub. Evaluate this session Scan this QR code to evaluate this session. © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

33 1/17/2019 6:32 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "TechEd 2013 1/17/2019 6:32 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks."

Similar presentations


Ads by Google