SlideShare a Scribd company logo
1 of 16
Getting Persistence Ignorant with Entity Framework Julie Lermanthedatafarm.com jlerman@thedatafarm.com Twitter @julielerman
Julie Lerman consultant/mentor Microsoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leader website theDataFarm.com blog & twitter theDataFarm.com/blog@julielerman book web site LearnEntityFramework.com 2nd Edition (EF4) is now available
Agenda Background info Restructure simple app Explore complex solution
“-ilities” Benefits: Extensibility Adaptability Testability Maintainability Quality  Why should You Care? Persistence Ignorance (PI) Future-Proofing your investment Slide courtesy of Stephen Bohlen
Persistence Dependence Inherits from System.Data.Objects.ObjectContext var context = new PublishingEntities(); var book= (from b in context select books            where bookid=3)           .First(); b.Status = “Sent to Printer”; context.SaveChanges(); Entity Framework method Persistence Ignorance varbookMgr = new BookManager(); var book=bookMgr.GetBook(3); book.Status=“Sent to Printer”; bookMgr.Update(book); *your* class *your* method
EF1 & Default EF4 Classes
Dependencies
ObjectContext Manages Entities POCO “Snapshot”4.0 POCO + Dynamic Runtime Proxy  (4.0) EntityObject (3.5 & 4.0) 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
POCO Basics With or without code generation “Convention” will auto-map classes/entities
EF4 POCO Support All entity properties must be represented Hand Code Code Generation with T4 and T4 templates Snapshot ObjectContext does all of the work Lazy Loading Virtual navigation properties Dynamic Runtime Proxies Mark all entity (model) properties as virtual Proxy emulates EntityObject behavior
IObjectSet Abstraction IObjectSet Collection-like behavior Add, Attach, Delete, etc. ObjectSet Concrete class Implements IObjectSet Inherits ObjectQuery public class ObjectSet:ObjectQuery,IObjectSet
Classes PI/Repositories System.Data.Entity Fake ObjectSet Fake Context & Data A EDM & ObjectContext Fake Context & Data B Unit of Work Class Repositories Class Repositories Class Repositories Class Repositories UI Tests
Entity Framework 4 Supports POCO Separation of concerns Unit Testing Coming soon: Code First, currently in CTP4, not released
Resources msdn.com/data Learnentityframework.com Testability and Entity Framework 4.0,Scott Allen, http://msdn.microsoft.com/en-us/ff714955.aspx Agile Entity Framework 4 Repository: blog series http://thedatafarm.com/blog/data-access/agile-entity-framework-4-repository-part-1-model-and-poco-classes/
Julie Lerman consultant/mentor Microsoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leader website theDataFarm.com blog & twitter theDataFarm.com/blog@julielerman book web site LearnEntityFramework.com 2nd Edition (EF4) is now available
Your Feedback is Important Please fill out a session evaluation form drop it off at the conference registration desk. Thank you!

More Related Content

Similar to Getting Persistence Ignorant with Entity Framework, Julie Lerman

Julie Lerman Agile Entity Framework (March 2010)
Julie Lerman Agile Entity Framework (March 2010)Julie Lerman Agile Entity Framework (March 2010)
Julie Lerman Agile Entity Framework (March 2010)Julie Lerman
 
Making Product Defensible with Scale by Quora Product Lead
Making Product Defensible with Scale by Quora Product LeadMaking Product Defensible with Scale by Quora Product Lead
Making Product Defensible with Scale by Quora Product LeadProduct School
 
Software Project Management for Entrepreneurs
Software Project Management for EntrepreneursSoftware Project Management for Entrepreneurs
Software Project Management for Entrepreneurszhurama
 
Mef 12 step program
Mef 12 step programMef 12 step program
Mef 12 step programJamesEggers
 
Accelerating the ML Lifecycle with an Enterprise-Grade Feature Store
Accelerating the ML Lifecycle with an Enterprise-Grade Feature StoreAccelerating the ML Lifecycle with an Enterprise-Grade Feature Store
Accelerating the ML Lifecycle with an Enterprise-Grade Feature StoreDatabricks
 
Distance learning skill topic 8 9 10
Distance learning skill topic 8 9 10 Distance learning skill topic 8 9 10
Distance learning skill topic 8 9 10 Devendran Muniandy
 
Machine Learning for Malware Classification and Clustering
Machine Learning for Malware Classification and ClusteringMachine Learning for Malware Classification and Clustering
Machine Learning for Malware Classification and ClusteringAshwini Almad
 
Machine Learning for Malware Classification and Clustering
Machine Learning for Malware Classification and ClusteringMachine Learning for Malware Classification and Clustering
Machine Learning for Malware Classification and ClusteringEndgameInc
 
Java Programming
Java ProgrammingJava Programming
Java ProgrammingTracy Clark
 
2017 10-10 (netflix ml platform meetup) learning item and user representation...
2017 10-10 (netflix ml platform meetup) learning item and user representation...2017 10-10 (netflix ml platform meetup) learning item and user representation...
2017 10-10 (netflix ml platform meetup) learning item and user representation...Ed Chi
 
Entity Framework NYC Firestarter
Entity Framework NYC FirestarterEntity Framework NYC Firestarter
Entity Framework NYC FirestarterJulie Lerman
 
Providence Future of Data Meetup - Apache Metron Open Source Cybersecurity Pl...
Providence Future of Data Meetup - Apache Metron Open Source Cybersecurity Pl...Providence Future of Data Meetup - Apache Metron Open Source Cybersecurity Pl...
Providence Future of Data Meetup - Apache Metron Open Source Cybersecurity Pl...Carolyn Duby
 
FutureSkills: Refreshing IT Skills in State and Local Government
FutureSkills: Refreshing IT Skills in State and Local GovernmentFutureSkills: Refreshing IT Skills in State and Local Government
FutureSkills: Refreshing IT Skills in State and Local GovernmentPaul W. Taylor
 
Building n-Tier ASP.NET WebForms with Entity Framework 4, Lerman
Building n-Tier ASP.NET WebForms with Entity Framework 4, LermanBuilding n-Tier ASP.NET WebForms with Entity Framework 4, Lerman
Building n-Tier ASP.NET WebForms with Entity Framework 4, LermanJulie Lerman
 
ItemMirror, XML & The Promise of Information Integration
ItemMirror, XML & The Promise of Information IntegrationItemMirror, XML & The Promise of Information Integration
ItemMirror, XML & The Promise of Information Integrationkeepingfoundthingsfound
 
00 C++ For Engineers and Scientists.pdf
00 C++ For Engineers and Scientists.pdf00 C++ For Engineers and Scientists.pdf
00 C++ For Engineers and Scientists.pdfKirubelWondwoson1
 
Email Is Dead... Long Live Email!
Email Is Dead... Long Live Email!Email Is Dead... Long Live Email!
Email Is Dead... Long Live Email!Wrike
 
Five things I learned about information security
Five things I learned about information securityFive things I learned about information security
Five things I learned about information securityMajor Hayden
 

Similar to Getting Persistence Ignorant with Entity Framework, Julie Lerman (20)

Julie Lerman Agile Entity Framework (March 2010)
Julie Lerman Agile Entity Framework (March 2010)Julie Lerman Agile Entity Framework (March 2010)
Julie Lerman Agile Entity Framework (March 2010)
 
Making Product Defensible with Scale by Quora Product Lead
Making Product Defensible with Scale by Quora Product LeadMaking Product Defensible with Scale by Quora Product Lead
Making Product Defensible with Scale by Quora Product Lead
 
Software Project Management for Entrepreneurs
Software Project Management for EntrepreneursSoftware Project Management for Entrepreneurs
Software Project Management for Entrepreneurs
 
Mef 12 step program
Mef 12 step programMef 12 step program
Mef 12 step program
 
Facebook business
Facebook businessFacebook business
Facebook business
 
Accelerating the ML Lifecycle with an Enterprise-Grade Feature Store
Accelerating the ML Lifecycle with an Enterprise-Grade Feature StoreAccelerating the ML Lifecycle with an Enterprise-Grade Feature Store
Accelerating the ML Lifecycle with an Enterprise-Grade Feature Store
 
Distance learning skill topic 8 9 10
Distance learning skill topic 8 9 10 Distance learning skill topic 8 9 10
Distance learning skill topic 8 9 10
 
Machine Learning for Malware Classification and Clustering
Machine Learning for Malware Classification and ClusteringMachine Learning for Malware Classification and Clustering
Machine Learning for Malware Classification and Clustering
 
Machine Learning for Malware Classification and Clustering
Machine Learning for Malware Classification and ClusteringMachine Learning for Malware Classification and Clustering
Machine Learning for Malware Classification and Clustering
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
2017 10-10 (netflix ml platform meetup) learning item and user representation...
2017 10-10 (netflix ml platform meetup) learning item and user representation...2017 10-10 (netflix ml platform meetup) learning item and user representation...
2017 10-10 (netflix ml platform meetup) learning item and user representation...
 
Entity Framework NYC Firestarter
Entity Framework NYC FirestarterEntity Framework NYC Firestarter
Entity Framework NYC Firestarter
 
Providence Future of Data Meetup - Apache Metron Open Source Cybersecurity Pl...
Providence Future of Data Meetup - Apache Metron Open Source Cybersecurity Pl...Providence Future of Data Meetup - Apache Metron Open Source Cybersecurity Pl...
Providence Future of Data Meetup - Apache Metron Open Source Cybersecurity Pl...
 
FutureSkills: Refreshing IT Skills in State and Local Government
FutureSkills: Refreshing IT Skills in State and Local GovernmentFutureSkills: Refreshing IT Skills in State and Local Government
FutureSkills: Refreshing IT Skills in State and Local Government
 
Building n-Tier ASP.NET WebForms with Entity Framework 4, Lerman
Building n-Tier ASP.NET WebForms with Entity Framework 4, LermanBuilding n-Tier ASP.NET WebForms with Entity Framework 4, Lerman
Building n-Tier ASP.NET WebForms with Entity Framework 4, Lerman
 
ItemMirror, XML & The Promise of Information Integration
ItemMirror, XML & The Promise of Information IntegrationItemMirror, XML & The Promise of Information Integration
ItemMirror, XML & The Promise of Information Integration
 
00 C++ For Engineers and Scientists.pdf
00 C++ For Engineers and Scientists.pdf00 C++ For Engineers and Scientists.pdf
00 C++ For Engineers and Scientists.pdf
 
Email Is Dead... Long Live Email!
Email Is Dead... Long Live Email!Email Is Dead... Long Live Email!
Email Is Dead... Long Live Email!
 
Mashups Campus Tech
Mashups Campus TechMashups Campus Tech
Mashups Campus Tech
 
Five things I learned about information security
Five things I learned about information securityFive things I learned about information security
Five things I learned about information security
 

More from Julie Lerman

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 APIsJulie Lerman
 
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)Julie Lerman
 
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 2017Julie Lerman
 
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 FeaturesJulie Lerman
 
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?Julie Lerman
 
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 platformJulie Lerman
 
Entity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignEntity Framework and Domain Driven Design
Entity Framework and Domain Driven DesignJulie Lerman
 
Julie Lerman: Entity Framework FTQs (Frequently Tweeted Questions)
Julie Lerman: Entity Framework FTQs (Frequently Tweeted Questions)Julie Lerman: Entity Framework FTQs (Frequently Tweeted Questions)
Julie Lerman: Entity Framework FTQs (Frequently Tweeted Questions)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
 
Entity Framework Today (May 2012)
Entity Framework Today (May 2012)Entity Framework Today (May 2012)
Entity Framework Today (May 2012)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
 
Perspectives on Entity Framework, Julie Lerman
Perspectives on Entity Framework, Julie LermanPerspectives on Entity Framework, Julie Lerman
Perspectives on Entity Framework, Julie LermanJulie Lerman
 
Persistence Ignorance in Entity Framework 4, Julie Lerman
Persistence Ignorance in Entity Framework 4, Julie LermanPersistence Ignorance in Entity Framework 4, Julie Lerman
Persistence Ignorance in Entity Framework 4, Julie LermanJulie Lerman
 
Persistence Ignorance in Entity Framework 4, Julie Lerman
Persistence Ignorance in Entity Framework 4, Julie LermanPersistence Ignorance in Entity Framework 4, Julie Lerman
Persistence Ignorance in Entity Framework 4, Julie LermanJulie Lerman
 
Entity Framework 4 and WCF
Entity Framework 4 and WCFEntity Framework 4 and WCF
Entity Framework 4 and WCFJulie Lerman
 
AgileEntity Framework 4
AgileEntity Framework 4AgileEntity Framework 4
AgileEntity Framework 4Julie Lerman
 
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 AspnetJulie Lerman
 
Lerman Vvs14 Ef Tips And Tricks
Lerman Vvs14  Ef Tips And TricksLerman Vvs14  Ef Tips And Tricks
Lerman Vvs14 Ef Tips And TricksJulie 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 WcfJulie Lerman
 

More from Julie Lerman (20)

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 FTQs (Frequently Tweeted Questions)
Julie Lerman: Entity Framework FTQs (Frequently Tweeted Questions)Julie Lerman: Entity Framework FTQs (Frequently Tweeted Questions)
Julie Lerman: Entity Framework FTQs (Frequently Tweeted Questions)
 
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)
 
Entity Framework Today (May 2012)
Entity Framework Today (May 2012)Entity Framework Today (May 2012)
Entity Framework Today (May 2012)
 
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
 
Persistence Ignorance in Entity Framework 4, Julie Lerman
Persistence Ignorance in Entity Framework 4, Julie LermanPersistence Ignorance in Entity Framework 4, Julie Lerman
Persistence Ignorance in Entity Framework 4, Julie Lerman
 
Persistence Ignorance in Entity Framework 4, Julie Lerman
Persistence Ignorance in Entity Framework 4, Julie LermanPersistence Ignorance in Entity Framework 4, Julie Lerman
Persistence Ignorance in Entity Framework 4, Julie Lerman
 
Entity Framework 4 and WCF
Entity Framework 4 and WCFEntity Framework 4 and WCF
Entity Framework 4 and WCF
 
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
 
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
 

Recently uploaded

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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...Miguel Araújo
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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...apidays
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 

Getting Persistence Ignorant with Entity Framework, Julie Lerman

  • 1. Getting Persistence Ignorant with Entity Framework Julie Lermanthedatafarm.com jlerman@thedatafarm.com Twitter @julielerman
  • 2. Julie Lerman consultant/mentor Microsoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leader website theDataFarm.com blog & twitter theDataFarm.com/blog@julielerman book web site LearnEntityFramework.com 2nd Edition (EF4) is now available
  • 3. Agenda Background info Restructure simple app Explore complex solution
  • 4. “-ilities” Benefits: Extensibility Adaptability Testability Maintainability Quality  Why should You Care? Persistence Ignorance (PI) Future-Proofing your investment Slide courtesy of Stephen Bohlen
  • 5. Persistence Dependence Inherits from System.Data.Objects.ObjectContext var context = new PublishingEntities(); var book= (from b in context select books where bookid=3) .First(); b.Status = “Sent to Printer”; context.SaveChanges(); Entity Framework method Persistence Ignorance varbookMgr = new BookManager(); var book=bookMgr.GetBook(3); book.Status=“Sent to Printer”; bookMgr.Update(book); *your* class *your* method
  • 6. EF1 & Default EF4 Classes
  • 8. ObjectContext Manages Entities POCO “Snapshot”4.0 POCO + Dynamic Runtime Proxy (4.0) EntityObject (3.5 & 4.0) 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
  • 9. POCO Basics With or without code generation “Convention” will auto-map classes/entities
  • 10. EF4 POCO Support All entity properties must be represented Hand Code Code Generation with T4 and T4 templates Snapshot ObjectContext does all of the work Lazy Loading Virtual navigation properties Dynamic Runtime Proxies Mark all entity (model) properties as virtual Proxy emulates EntityObject behavior
  • 11. IObjectSet Abstraction IObjectSet Collection-like behavior Add, Attach, Delete, etc. ObjectSet Concrete class Implements IObjectSet Inherits ObjectQuery public class ObjectSet:ObjectQuery,IObjectSet
  • 12. Classes PI/Repositories System.Data.Entity Fake ObjectSet Fake Context & Data A EDM & ObjectContext Fake Context & Data B Unit of Work Class Repositories Class Repositories Class Repositories Class Repositories UI Tests
  • 13. Entity Framework 4 Supports POCO Separation of concerns Unit Testing Coming soon: Code First, currently in CTP4, not released
  • 14. Resources msdn.com/data Learnentityframework.com Testability and Entity Framework 4.0,Scott Allen, http://msdn.microsoft.com/en-us/ff714955.aspx Agile Entity Framework 4 Repository: blog series http://thedatafarm.com/blog/data-access/agile-entity-framework-4-repository-part-1-model-and-poco-classes/
  • 15. Julie Lerman consultant/mentor Microsoft MVP, INETA Speaker,ASPInsider, MCP, VTdotNET Leader website theDataFarm.com blog & twitter theDataFarm.com/blog@julielerman book web site LearnEntityFramework.com 2nd Edition (EF4) is now available
  • 16. Your Feedback is Important Please fill out a session evaluation form drop it off at the conference registration desk. Thank you!