SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Julie Lerman: Agile Entity Framework 4  [ESDC March 2010] Agile Entity Framework 4 Julie Lerman thedatafarm.com/blog jlerman@thedatafarm.com Twitter @julielermanvt
Julie Lerman Julie Lerman: Agile Entity Framework 4  [ESDC March 2010] website theDataFarm.com blog & twitter theDataFarm.com/blog@julielermanVT book web site LearnEntityFramework.com consultant/mentor Microsoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leader 2nd Edition Spring 2010
Agenda Agile Entities POCO Classes Leveraging Proxies Customizable T4 Code Generation Persistence Ignorance Agile Modeling Model-First (Model-less) Code-Only Development  Julie Lerman: Agile Entity Framework 4  [ESDC March 2010]
ObjectContext Manages Entities Julie Lerman: Agile Entity Framework 4  [ESDC March 2010] ObjectContext Person Object State info State info Order Object State info Detail Object State info Detail Object State info Order Object State info Detail Object State info Detail Object
Agile Entities in EF4 EF3.5 Requires EntityObject Provides automated entity management Entities bound to EF API EF4 Adds POCO Support Smarter ObjectContext Loose Coupling Persistence Ignorance Repositories & Unit Testing Julie Lerman: Agile Entity Framework 4  [ESDC March 2010]
POCO: Shifting the Responsibility Julie Lerman: Agile Entity Framework 4  [ESDC March 2010] ObjectSet “Snapshot” ObjectContext POCO Classes DynamicProxy (similar to EntityObject) “Proxy Notification”
Basic POCO Support Turn off code generation from EDMX “Convention” will auto-map classes/entities Julie Lerman: Agile Entity Framework 4  [ESDC March 2010]
POCO and Other EF Features Complex Types Use a class (no structs) to represent the type Explicit Loading ObjectContext.LoadProperty(myObj,”PropertyName”) ObjectContext.LoadProperty(myObj, o=>o.property) Lazy Loading (new to EF4) Virtual navigation properties get run-time proxy Two-Way Navigation Must be coded into classes Julie Lerman: Agile Entity Framework 4  [ESDC March 2010]
Dynamic Proxies Classes must be completely virtual Every single property Dynamic Proxy created at run time Provide features similar to EntityObject Change notification Relationship management Lazy Loading Lots of rules  Julie Lerman: Agile Entity Framework 4  [ESDC March 2010]
Rules for Proxy Notification All properties must be virtual Use ICollection<T> for child collections ObjectContext.CreateObject<T> for new Class cannot be sealed Navigation properties cannot be sealed Class cannot be abstract           Must have a constructor with no parameters Julie Lerman: Agile Entity Framework 4  [ESDC March 2010]
Code Gen POCOs from Model Julie Lerman: Agile Entity Framework 4  [ESDC March 2010] T4 More in Kathleen Dollard’s 2:30 talk, Wednesday: T4: Code Generation Microsoft Style Text Template Transformation Toolkit
Classes Persistence Ignorance/Repository System.Data.Entity Mock ObjectSet Mock Context A EDM & ObjectContext Mock Context B Class Repositories Class Repositories Class Repositories Class Repositories UI Tests Julie Lerman: Agile Entity Framework 4  [ESDC March 2010]
Agile Modeling in EF4 Julie Lerman: Agile Entity Framework 4  [ESDC March 2010] *Available in separate download: EF Feature CTP
Model First Define model Define entities, properties, property attributes Entity Keys, Identity Keys  Field Type, Length, defaults. Relationships & their constraints (e.g. 1:*) Inheritance (TPT default) “Generate DB from Model” = Create DDL Run DDL against existing DB Julie Lerman: Agile Entity Framework 4  [ESDC March 2010]
Code-Only Design Part of the EF Feature CTP No model at all Metadata is inferred from classes Convention by Default EF will rely 100% on presumptions Configuration Follows Tweak configurations to modify behavior Julie Lerman: Agile Entity Framework 4  [ESDC March 2010]
Resources LearnEntityFramework.com/resources thedatafarm.com/blog/tags/ef4 blogs.msdn.com/adonet, efdesign, dsimmons, alexj,  more... msdn.microsoft.com/data Gateway to whitepapers, forums, documentation Lots of bloggers on EF now! Google!  Julie Lerman: Agile Entity Framework 4  [ESDC March 2010]
Contact Julie Lerman: Agile Entity Framework 4  [ESDC March 2010] website theDataFarm.com blog & twitter theDataFarm.com/blog@julielermanVT book web site LearnEntityFramework.com consultant/mentor Microsoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leader

Weitere Àhnliche Inhalte

Ähnlich wie Julie Lerman Agile Entity Framework (March 2010)

Entities, Bundles, and Fields: You need to understand this!
Entities, Bundles, and Fields: You need to understand this!Entities, Bundles, and Fields: You need to understand this!
Entities, Bundles, and Fields: You need to understand this!
tedbow
 

Ähnlich wie Julie Lerman Agile Entity Framework (March 2010) (20)

Entity Framework Today (May 2012)
Entity Framework Today (May 2012)Entity Framework Today (May 2012)
Entity Framework Today (May 2012)
 
Pomeriggio Entity Framework - Database First
Pomeriggio Entity Framework - Database FirstPomeriggio Entity Framework - Database First
Pomeriggio Entity Framework - Database First
 
Using Entity Framework's New POCO Features: Part 1, by Julie Lerman
Using Entity Framework's New POCO Features: Part 1, by Julie LermanUsing Entity Framework's New POCO Features: Part 1, by Julie Lerman
Using Entity Framework's New POCO Features: Part 1, by Julie Lerman
 
Entities, Bundles, and Fields: You need to understand this!
Entities, Bundles, and Fields: You need to understand this!Entities, Bundles, and Fields: You need to understand this!
Entities, Bundles, and Fields: You need to understand this!
 
Entity Framework 4 In Microsoft Visual Studio 2010
Entity Framework 4 In Microsoft Visual Studio 2010Entity Framework 4 In Microsoft Visual Studio 2010
Entity Framework 4 In Microsoft Visual Studio 2010
 
Architecting Smarter Apps with Entity Framework
Architecting Smarter Apps with Entity FrameworkArchitecting Smarter Apps with Entity Framework
Architecting Smarter Apps with Entity Framework
 
Entity Framework 4
Entity Framework 4Entity Framework 4
Entity Framework 4
 
Getting Persistence Ignorant with Entity Framework, Julie Lerman
Getting Persistence Ignorant with Entity Framework, Julie LermanGetting Persistence Ignorant with Entity Framework, Julie Lerman
Getting Persistence Ignorant with Entity Framework, Julie Lerman
 
Lerman Vvs13 Entity Framework 4 And Wcf
Lerman Vvs13 Entity Framework 4 And WcfLerman Vvs13 Entity Framework 4 And Wcf
Lerman Vvs13 Entity Framework 4 And Wcf
 
What's New in Entity Framework 4, by Julie Lerman
What's New in Entity Framework 4, by Julie LermanWhat's New in Entity Framework 4, by Julie Lerman
What's New in Entity Framework 4, by Julie Lerman
 
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource GroupLINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
 
Entity Framework 4
Entity Framework 4Entity Framework 4
Entity Framework 4
 
.NET Core, ASP.NET Core Course, Session 13
.NET Core, ASP.NET Core Course, Session 13.NET Core, ASP.NET Core Course, Session 13
.NET Core, ASP.NET Core Course, Session 13
 
E-R model unit(Iv)
E-R model unit(Iv)E-R model unit(Iv)
E-R model unit(Iv)
 
Singleton Object Management
Singleton Object ManagementSingleton Object Management
Singleton Object Management
 
Ef overview
Ef overviewEf overview
Ef overview
 
MVC and Entity Framework 4
MVC and Entity Framework 4MVC and Entity Framework 4
MVC and Entity Framework 4
 
Primary Key & Foreign Key part10
Primary Key & Foreign Key part10Primary Key & Foreign Key part10
Primary Key & Foreign Key part10
 
ASP.NET MVC and Entity Framework 4
ASP.NET MVC and Entity Framework 4ASP.NET MVC and Entity Framework 4
ASP.NET MVC and Entity Framework 4
 
Metadata Cloud
Metadata CloudMetadata Cloud
Metadata Cloud
 

Mehr von Julie Lerman

Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)
Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)
Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)
Julie Lerman
 
Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)
Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)
Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)
Julie Lerman
 

Mehr von Julie Lerman (15)

EF Core in Containerized ASP.NET Core APIs
EF Core in Containerized ASP.NET Core APIsEF Core in Containerized ASP.NET Core APIs
EF Core in Containerized ASP.NET Core APIs
 
Domain-Driven Design with Tender Loving Care (DDD with TLC)
Domain-Driven Design with Tender Loving Care (DDD with TLC)Domain-Driven Design with Tender Loving Care (DDD with TLC)
Domain-Driven Design with Tender Loving Care (DDD with TLC)
 
What's New in Visual Studio 2017
What's New in Visual Studio 2017What's New in Visual Studio 2017
What's New in Visual Studio 2017
 
A Tour of EF Core's (1.1) Most Interesting & Important Features
A Tour of EF Core's (1.1) Most Interesting & Important FeaturesA Tour of EF Core's (1.1) Most Interesting & Important Features
A Tour of EF Core's (1.1) Most Interesting & Important Features
 
EF6 or EF Core? How Do I Choose?
EF6 or EF Core? How Do I Choose?EF6 or EF Core? How Do I Choose?
EF6 or EF Core? How Do I Choose?
 
Microsoft for developers open source and cross platform
Microsoft for developers  open source and cross platformMicrosoft for developers  open source and cross platform
Microsoft for developers open source and cross platform
 
Entity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignEntity Framework and Domain Driven Design
Entity Framework and Domain Driven Design
 
RavenDB Overview
RavenDB OverviewRavenDB Overview
RavenDB Overview
 
Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)
Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)
Julie Lerman Entity Framework in the Enterprise (Boston Code Camp March 2013)
 
Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)
Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)
Working With Sql Azure from Entity Framework On-Premises (Julia Lerman)
 
Perspectives on Entity Framework, Julie Lerman
Perspectives on Entity Framework, Julie LermanPerspectives on Entity Framework, Julie Lerman
Perspectives on Entity Framework, Julie Lerman
 
AgileEntity Framework 4
AgileEntity Framework 4AgileEntity Framework 4
AgileEntity Framework 4
 
Lerman Adx303 Entity Framework 4 In Aspnet
Lerman Adx303 Entity Framework 4 In AspnetLerman Adx303 Entity Framework 4 In Aspnet
Lerman Adx303 Entity Framework 4 In Aspnet
 
Lerman Vvs14 Ef Tips And Tricks
Lerman Vvs14  Ef Tips And TricksLerman Vvs14  Ef Tips And Tricks
Lerman Vvs14 Ef Tips And Tricks
 
Data in the Azure Cloud, by Julie Lerman
Data in the Azure Cloud, by Julie LermanData in the Azure Cloud, by Julie Lerman
Data in the Azure Cloud, by Julie Lerman
 

KĂŒrzlich hochgeladen

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

KĂŒrzlich hochgeladen (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Julie Lerman Agile Entity Framework (March 2010)

  • 1. Julie Lerman: Agile Entity Framework 4 [ESDC March 2010] Agile Entity Framework 4 Julie Lerman thedatafarm.com/blog jlerman@thedatafarm.com Twitter @julielermanvt
  • 2. Julie Lerman Julie Lerman: Agile Entity Framework 4 [ESDC March 2010] website theDataFarm.com blog & twitter theDataFarm.com/blog@julielermanVT book web site LearnEntityFramework.com consultant/mentor Microsoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leader 2nd Edition Spring 2010
  • 3. Agenda Agile Entities POCO Classes Leveraging Proxies Customizable T4 Code Generation Persistence Ignorance Agile Modeling Model-First (Model-less) Code-Only Development Julie Lerman: Agile Entity Framework 4 [ESDC March 2010]
  • 4. ObjectContext Manages Entities Julie Lerman: Agile Entity Framework 4 [ESDC March 2010] ObjectContext Person Object State info State info Order Object State info Detail Object State info Detail Object State info Order Object State info Detail Object State info Detail Object
  • 5. Agile Entities in EF4 EF3.5 Requires EntityObject Provides automated entity management Entities bound to EF API EF4 Adds POCO Support Smarter ObjectContext Loose Coupling Persistence Ignorance Repositories & Unit Testing Julie Lerman: Agile Entity Framework 4 [ESDC March 2010]
  • 6. POCO: Shifting the Responsibility Julie Lerman: Agile Entity Framework 4 [ESDC March 2010] ObjectSet “Snapshot” ObjectContext POCO Classes DynamicProxy (similar to EntityObject) “Proxy Notification”
  • 7. Basic POCO Support Turn off code generation from EDMX “Convention” will auto-map classes/entities Julie Lerman: Agile Entity Framework 4 [ESDC March 2010]
  • 8. POCO and Other EF Features Complex Types Use a class (no structs) to represent the type Explicit Loading ObjectContext.LoadProperty(myObj,”PropertyName”) ObjectContext.LoadProperty(myObj, o=>o.property) Lazy Loading (new to EF4) Virtual navigation properties get run-time proxy Two-Way Navigation Must be coded into classes Julie Lerman: Agile Entity Framework 4 [ESDC March 2010]
  • 9. Dynamic Proxies Classes must be completely virtual Every single property Dynamic Proxy created at run time Provide features similar to EntityObject Change notification Relationship management Lazy Loading Lots of rules Julie Lerman: Agile Entity Framework 4 [ESDC March 2010]
  • 10. Rules for Proxy Notification All properties must be virtual Use ICollection<T> for child collections ObjectContext.CreateObject<T> for new Class cannot be sealed Navigation properties cannot be sealed Class cannot be abstract Must have a constructor with no parameters Julie Lerman: Agile Entity Framework 4 [ESDC March 2010]
  • 11. Code Gen POCOs from Model Julie Lerman: Agile Entity Framework 4 [ESDC March 2010] T4 More in Kathleen Dollard’s 2:30 talk, Wednesday: T4: Code Generation Microsoft Style Text Template Transformation Toolkit
  • 12. Classes Persistence Ignorance/Repository System.Data.Entity Mock ObjectSet Mock Context A EDM & ObjectContext Mock Context B Class Repositories Class Repositories Class Repositories Class Repositories UI Tests Julie Lerman: Agile Entity Framework 4 [ESDC March 2010]
  • 13. Agile Modeling in EF4 Julie Lerman: Agile Entity Framework 4 [ESDC March 2010] *Available in separate download: EF Feature CTP
  • 14. Model First Define model Define entities, properties, property attributes Entity Keys, Identity Keys Field Type, Length, defaults. Relationships & their constraints (e.g. 1:*) Inheritance (TPT default) “Generate DB from Model” = Create DDL Run DDL against existing DB Julie Lerman: Agile Entity Framework 4 [ESDC March 2010]
  • 15. Code-Only Design Part of the EF Feature CTP No model at all Metadata is inferred from classes Convention by Default EF will rely 100% on presumptions Configuration Follows Tweak configurations to modify behavior Julie Lerman: Agile Entity Framework 4 [ESDC March 2010]
  • 16. Resources LearnEntityFramework.com/resources thedatafarm.com/blog/tags/ef4 blogs.msdn.com/adonet, efdesign, dsimmons, alexj, more... msdn.microsoft.com/data Gateway to whitepapers, forums, documentation Lots of bloggers on EF now! Google!  Julie Lerman: Agile Entity Framework 4 [ESDC March 2010]
  • 17. Contact Julie Lerman: Agile Entity Framework 4 [ESDC March 2010] website theDataFarm.com blog & twitter theDataFarm.com/blog@julielermanVT book web site LearnEntityFramework.com consultant/mentor Microsoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leader