Top Banner
25
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.
Page 2: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

The ADO.NET Entity Framework 4

Shyam Pather ([email protected])Development ManagerMicrosoftSession Code: DTL402

Page 3: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

Session Objectives And Takeaways

Discuss the Entity FrameworkHistoric PerspectiveImprovements in Visual Studio 2010Priorities Post Visual Studio 2010

Key TakeawaysEntity Framework is responding to customer feedback and is ready for prime time.Microsoft is investing in a modeling platform and Entity Framework will be the ORM stack for your model.

Page 4: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

History of the Entity Data Model Object Spaces, Microsoft Business Framework and WinFS were pre-Entity Framework development efforts

The Entity Data Model (EDM) emerged out of this as a way to unify data models across Microsoft

Entity FrameworkADO.NET Data Services (Astoria)Reporting ServicesAnalysis ServicesSystem ManagementEtc..

Page 5: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

What is this EDM thing?

Describe your model using basic concepts of “Entity” and “Association”

Entity represents a “Thing”Association represents the “Relationship” between these Entities

EDM builds on these two conceptsDefine a domain model that can map to classes & tables and that can be rationalized with other models.

Page 6: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

EDM & Entity Framework?

The Entity Framework (EF) is an Object Relational Modeling tool leveraging the EDM

Focus on your domain, not how to persist!EDM is used to describe your model.

Allows different rate of change between database and code!

EF uses a storage model and mapping to enable this.

Page 7: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

Vote of no Confidence

Entity Framework in 3.5 SP1 is:

Too complex. Too many steps are required.Too many restrictions. I want control over my code.Not in sync with the way I work: TDD, N-Tier, Patterns

Page 8: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

Pain Points in v3.5SP1

Pluralization/SingularizationForeign KeysModel FirstLazy LoadingAdditional LINQ OperatorsL2S Features & PatternsSQL Gen Improvements

Page 9: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

Entity Framework Today:Improved Communication

Entity Framework Team Bloghttp://blogs.msdn.com/adonet/Entity Framework Design Blog http://blogs.msdn.com/efdesign/P&P Guidancehttp://dataguidance.codeplex.com/Increase feedback through Feature CTPs

Page 10: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

Entity Framework in .NET 4

Improvements:Model FirstT4 Templates to control code generationSupporting DDD approach with POCO

Persistence IgnoranceRepository pattern

Query ImprovementsLazy LoadingDisconnected API’s to enable N-tier

Page 11: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

EF Basics: Getting your model from the database

demo

Plus LINQ, Databinding, and Change Tracking

Page 12: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

Data Classes: T4 & POCOdemo

Page 13: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

Model First: Modeling your domain without a database

demo

Page 14: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

Feature CTPs

What?Preview of features coming in a future releaseAll built on public APIs

Nothing you couldn’t do yourself

Feature CTP1POCO templateSelf tracking entitiesCode Only

Page 15: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

POCO Templatesdemo

T4 for Persistence Ignorance

Page 16: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

Self Tracking Entitiesdemo

N-Tier Support

Page 17: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

Code Onlydemo

Just Code!

Page 18: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

Entity Framework - Tomorrow

We will soon ship EF 4 Beta 2 with:Foreign Key supportLazy Loading by defaultEtc..…

We are planning a refresh of the Feature CTP around Beta 2 with:

Mapping configuration inside Code Only.

Page 19: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

question & answer

Page 20: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

My Contact Info

[email protected]

Page 21: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

www.microsoft.com/teched

International Content & Community

http://microsoft.com/technet

Resources for IT Professionals

http://microsoft.com/msdn

Resources for Developers

www.microsoft.com/learning

Microsoft Certification & Training Resources

Resources Tech·Ed Africa 2009 sessions will be made available for download the week after the event from: www.tech-ed.co.za

Page 22: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

Track Resources

ADO.NET Team Blog: http://blogs.msdn.com/adonet/

Entity Framework Design Blog: http://blogs.msdn.com/efdesign/

Daniel Simmons’s Blog: http://blogs.msdn.com/dsimmons/

Visual Studio Data Blog: http://blogs.msdn.com/vsdata/

Page 23: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

Related ContentSessions:•DTL312: The ADO.NET Entity Framework: Tips & Tricks

•DTL208: An Introduction to the ADO.NET Data Services Framework v1.5

•DTL401: How LINQ Works: A Deep Dive into the Microsoft Visual Basic and C# Implementations

Whiteboard Sessions:•WTB211: A Strategic Comparison of Data Access Technologies from Microsoft

Hotlabs:•DTL20H: Application Development with the ADO.NET Entity Framework in the Microsoft .NET Framework 4

Page 24: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

Complete a session evaluation and enter to win!

10 pairs of MP3 sunglasses to be won

Page 25: Shyam Pather (spather@microsoft.com) Development Manager Microsoft Session Code: DTL402.

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista 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.