eric nelson [email protected] (or )

20
Eric Nelson [email protected] http://geekswithblogs.net/iupd ateable (or http://bit.ly/ericnelson ) http://twitter.com/ericnel http://twitter.com/ukmsdn Developer Evangelist Microsoft UK

Upload: joel-scott

Post on 12-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Eric Nelson eric.nelson@microsoft.com  (or  )

Eric Nelson [email protected]://geekswithblogs.net/iupdateable (or http://bit.ly/ericnelson )http://twitter.com/ericnel http://twitter.com/ukmsdn

Developer EvangelistMicrosoft UK

Page 2: Eric Nelson eric.nelson@microsoft.com  (or  )

Were you on twitter last Dec?http://twitter.com/ericnel

Page 3: Eric Nelson eric.nelson@microsoft.com  (or  )

Agenda

Quick recap of the journey so farEntity Framework 4.0 Drill Down

Lots of demos

Page 4: Eric Nelson eric.nelson@microsoft.com  (or  )

Object Relational Mapping

Many ORMs out thereNo clear “winner” = relatively little adoption of ORMDevelopers waiting on MicrosoftThen we shipped two ... hmmm

LINQ to SQL in Visual Studio 2008ADO.NET Entity Framework in Visual Studio 2008 SP1

Page 5: Eric Nelson eric.nelson@microsoft.com  (or  )

ADO.NET Entity Framework Recap

Tools and services to create an Entity Data Model (EDM)

Conceptual to Mapping to StorageTools and services for consuming an Entity Data Model

LINQ to Entities, Object Services and Entity SQL

Together they address the “impedance mismatch”

ConceptualConceptual

MappingMapping

StorageStorage

Entity Data ModelEntity Data Model

Rows in Tables

Rows in Tables

Objects in ApplicationsObjects in

Applications

Page 6: Eric Nelson eric.nelson@microsoft.com  (or  )

Entity Framework 1.0Too many pain points

The designer!Model First not supportedPoor support for Stored ProceduresNo Pluralization/SingularizationForeign Keys hiddenLazy Loading not supportedMissing LINQ Operators vs LINQ to SQLGenerated SQL unreadableNo support for Plain Old CLR ObjectsN-Tier difficult

Page 7: Eric Nelson eric.nelson@microsoft.com  (or  )

Entity Framework 4.0 Removing the friction

Better Tools and Design ExperienceMore powerful/flexible runtimeAnd

Persistence Ignorance*Code Only*N-Tier*

Note:* Delivered in .NET Framework 4 and a separate download

Page 8: Eric Nelson eric.nelson@microsoft.com  (or  )

Better Tools and Design Experience

Model FirstTemplated code generationStored ProceduresPluralization/Singularization Complex TypesBetter delete and search

Page 9: Eric Nelson eric.nelson@microsoft.com  (or  )

Model First and Templated Code Generation

Page 10: Eric Nelson eric.nelson@microsoft.com  (or  )

More powerful/flexible runtime

Lazy Loading (Deferred Loading in Beta 1 )Foreign Keys surfacedMore complete LINQ implementationExecuteStoreQueryEntityFunctions and SqlFunctionsImprovements to generated SQL

Page 11: Eric Nelson eric.nelson@microsoft.com  (or  )

Deferred Loading, Functions, Generated SQL

Page 12: Eric Nelson eric.nelson@microsoft.com  (or  )

http://blogs.msdn.com/adonet/archive/2009/08/05/improvements-to-the-generated-sql-in-net-4-0-beta1.aspx

Page 13: Eric Nelson eric.nelson@microsoft.com  (or  )

Persistence Ignorance

First class support for Persistence Ignorance No modifications to your classes!

Page 14: Eric Nelson eric.nelson@microsoft.com  (or  )

Persistence Ignorance

Page 15: Eric Nelson eric.nelson@microsoft.com  (or  )

Code Only

Create the database from the classesNo modelConvention to config

Page 16: Eric Nelson eric.nelson@microsoft.com  (or  )

Code Only

Page 17: Eric Nelson eric.nelson@microsoft.com  (or  )

N-Tier

Self Tracking Entities

Page 18: Eric Nelson eric.nelson@microsoft.com  (or  )

N-Tier

Page 19: Eric Nelson eric.nelson@microsoft.com  (or  )

Entity Framework

The designer!No support for Plain Old CLR ObjectsNo Pluralization/SingularizationForeign Keys hiddenModel First not supportedLazy Loading not supportedMissing LINQ Operators vs LINQ to SQLGenerated SQL unreadableN-Tier difficultPoor support for Stored Procedures

Page 20: Eric Nelson eric.nelson@microsoft.com  (or  )

Summary