SlideShare a Scribd company logo
Building nTier Applications with Entity Framework Services
Building N Tier Applications With Entity Framework Services 2010
Agenda
Overview
nTier Architecture OverviewModel to create flexible reusable applicationsOnly need to modify or add layers instead of rewriting entire applications over
Where’s Your Data Model?Applications Today…Implicitly Contain the Data ModelLogic and Model IntertwinedConceptual MismatchOften encapsulate in a "Data Access Layer"
Where’s Your Data Model?What Is Really Needed
Applications work with a well Defined Model
Storage Schema Abstraction
Declarative mapping between application and storage models
No brittle, hard-coded mappingEntity Framework
 Object Relational MappingWhat is ORM?Technique for working with relational tables as if they were objects in memoryIntention is to hide away the complexity of the underlying tables and give a uniform way of working with dataWhy use ORM?ProductivityRetain database independenceObjectsClassesEntities
 Object Relational MappingThere are many ORMs for .NET developers already in existence. E.g.LLBLGen Pro http://www.llblgen.com/Nhibernate http://www.hibernate.org/343.htmlEntitySpaces http://www.entityspaces.net/Portal/Default.aspx
The Microsoft Entity Data ModelAn extended relational model with Entity-Relationship Model  conceptsEntity TypesStrong type with IdentityInheritanceScalar/Complex propertiesEntitySetsHold instances of Entity TypesSimilar to relational tablesCan have multiple Entitysets of the same EntityTypesRelationships ("Associations")Named relationships between Entities0..1:*, 0..1:0..1, 1:1, 1:M, M:NNavigation may be exposed as NavigationProperties on EntityTypesAssociationSetsContains instances of associationsMay be queried directlyEntityContainersContains EntitySets, AssociationSetsSalesPersonEmployeeID = 294272LoginID = adamTitle = "Dev Lead"VacationHours = 0…Manager11NReportsSalesPersonSalesPersonEmployeeID = 729742LoginID = peteTitle = "Developer"VacationHours = 0…ExpenseAccount = …CarLicenseNum = ……SalesPersonEmployeeID = 729742LoginID = peteTitle = "Developer"VacationHours = 0…ExpenseAccount = …CarLicenseNum = ……EmployeeID = 729742LoginID = peteTitle = "Developer"VacationHours = 0…ExpenseAccount = true…
EDM & Entity Framework?The Entity Framework (EF) is an Object Relational Modeling tool leveraging the EDMFocus 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.
ADO.NET Entity Framework
EF Providers in Progress
LINQ to Entities – Lots of Topics
Building N Tier Applications With Entity Framework Services 2010
Using Entity Framework with ASP.NET
Pain Points in v3.5 SP1Pluralization/ SingularizationForeign KeysModel FirstLazy LoadingAdditional LINQ OperatorsL2S Features & PatternsSQL Gen Improvements
Entity Framework in .NET 4Improvements:Model FirstT4 Templates to control code generationSupporting DDD approach with POCO Persistence IgnoranceRepository patternQuery ImprovementsLazy LoadingDisconnected API’s to enable N-tier
Easily Expose Your EntitiesWCF Data Services
Data Services OverviewExtends Windows Communication FoundationFunctionalityCRUD access to data over RESTful web servicesBuilt-in URI-based query syntaxClient-side libraries for .NET and AJAX clients
Data ServicesHTTPOpen Data ProtocolHosting/HTTP ListenerData Services RuntimeIQueryable/IEnumerable[+ IUpdatable]Data Access LayerEntity FrameworkCustom LINQ ProviderRelational databaseOther sources
Data Services - A REST InterfaceThe underlying model
Entities and associations  resources and linksWCF 4Programming ModelCore ServicesWeb HTTP ServicesData ServicesRIA ServicesWorkflow ServicesService ModelData ContractService ContractService  BehaviorChannel ModelFormats(Atom, JSON, XML,…)Transports(HTTP, TCP, …)Protocols(SOAP, HTTP, Open Data Protocol,…)
URL ConventionsAddressing entities and setsPresentation optionsModern Data-Driven Web AppsAJAX integrationAJAX-friendly JSON format in servicesJavascript library that integrates with the ASP.NET AJAX toolkitSilverlight support.NET programming model for data servicesObject based, LINQ enabled APICode-gen entity types from metadata
"Traditional" ApplicationsWeb applicationsData services client can be used in ASP.NETASP.NET data source control for accessing remote servicesDesktop applicationsFully-featured .NET client librarySame API in desktop and Silverlight environments
What’s New in .NET 4Data BindingNew DataServiceCollection class provides simplified binding of data service data to (WPF) controls. Includes auto updating.Counting Entities in an Set $count - total number of resources returned by a URI$inlinecount - total resource count together with the resource dataServer-driven Paging Service can be configured to return requested resources as a set of paged responses
What’s New in .NET 4Query ProjectionsQuery results can be modified to include only a subset of properties by using the new $select query option.Custom Data Service ProvidersCan implement a set of new data service provider interfaces, you can use various types of data with a data service, even when the data model changes during execution.Streaming of Binary ResourcesThis enables you to retrieve and save binary large object data independent of the entity to which it belongs.
Building N Tier Applications With Entity Framework Services 2010
Summary
Conclusion
Before You Begin…What I Have Learned So Far About The Entity Framework and ADO.NET Data Serviceshttp://dotnettips.com/2008/09/30/WhatIHaveLearnedSoFarAboutTheEntityFrameworkAndADONETDataServices.aspx*Part 2 coming out soon!Using Microsoft ADO.NET Data Serviceshttp://msdn.microsoft.com/en-us/library/cc907912.aspx
ResourcesADO.NET Team Bloghttp://blogs.msdn.com/adonet/default.aspxEF Design Blogblogs.msdn.com/efdesignVisual Studio Data Bloghttp://blogs.msdn.com/vsdata/dnrTV!http://shrinkster.com/1734http://shrinkster.com/1735
ResourcesDan Simmons Bloghttp://blogs.msdn.com/dsimmons/MSDN Code Galleryhttp://shrinkster.com/1733WCF Data Services Learning Guide:http://msdn.microsoft.com/en-us/data/bb931106.aspxWCF Data Services Team Bloghttp://blogs.msdn.com/astoriateam/default.aspx

More Related Content

PPTX
Entity Framework - Entity Data Model (edm)
PPTX
Entity Framework Overview
PPTX
Building nTier Applications with Entity Framework Services
PPTX
Building nTier Applications with Entity Framework Services (Part 1)
PPT
Hibernate
PPT
What is hibernate?
PPTX
ADO .NET by Sonu Vishwakarma
PDF
What is hibernate?
Entity Framework - Entity Data Model (edm)
Entity Framework Overview
Building nTier Applications with Entity Framework Services
Building nTier Applications with Entity Framework Services (Part 1)
Hibernate
What is hibernate?
ADO .NET by Sonu Vishwakarma
What is hibernate?

What's hot (20)

DOCX
What is hibernate?
PPT
contentDM
PPTX
Microsoft Entity Framework
PPTX
Azure DocumentDb Training - Accessing DocumentDb from .net
PPT
Library Web Services for Discovery and Delivery of Scientific Information
PPTX
Introducing Entity Framework Core
PPTX
Azure DocumentDb Training - Resource Model
PPTX
LINQ in C#
PPTX
C# Code Samples
PPTX
Overview of VS2010 and .NET 4.0
PDF
Asp net interview_questions
PPT
Hibernate training-topics
PDF
Encompassing Information Integration
PPTX
W8/WP8 App Dev for SAP, Part 2: Microsoft OData Application Development
PPTX
Architecting Cloudy Applications
PPTX
Introduction to PredictionIO
PPTX
Whats new in Access Services 2013?
PPT
Entity framework 4.0
PPTX
SAP BusinessObjects Web Intelligence Report
What is hibernate?
contentDM
Microsoft Entity Framework
Azure DocumentDb Training - Accessing DocumentDb from .net
Library Web Services for Discovery and Delivery of Scientific Information
Introducing Entity Framework Core
Azure DocumentDb Training - Resource Model
LINQ in C#
C# Code Samples
Overview of VS2010 and .NET 4.0
Asp net interview_questions
Hibernate training-topics
Encompassing Information Integration
W8/WP8 App Dev for SAP, Part 2: Microsoft OData Application Development
Architecting Cloudy Applications
Introduction to PredictionIO
Whats new in Access Services 2013?
Entity framework 4.0
SAP BusinessObjects Web Intelligence Report
Ad

Viewers also liked (8)

PPT
N tier web applications
PPTX
Building n-Tier ASP.NET WebForms with Entity Framework 4, Lerman
PPT
E business n_tier_arch
PPTX
N-tier Application Developement
PPTX
N-tier and oop - moving across technologies
PPTX
N tier
DOCX
J2EE and layered architecture
PDF
N-Tier, Layered Design, SOA
N tier web applications
Building n-Tier ASP.NET WebForms with Entity Framework 4, Lerman
E business n_tier_arch
N-tier Application Developement
N-tier and oop - moving across technologies
N tier
J2EE and layered architecture
N-Tier, Layered Design, SOA
Ad

Similar to Building N Tier Applications With Entity Framework Services 2010 (20)

PPTX
Building nTier Applications with Entity Framework Services (Part 1)
PPTX
Entity framework
PPTX
Programming is Fun with ASP.NET MVC
PDF
70487.pdf
PPTX
Ado.net entity framework_4.0
PPT
What's New for Data?
PDF
ASP.NET Core Interview Questions PDF By ScholarHat.pdf
PPTX
Entity Core with Core Microservices.pptx
PPT
ADO.NET Entity Framework
PPTX
Asp.Net Core MVC with Entity Framework
PDF
Elements of DDD with ASP.NET MVC & Entity Framework Code First
PDF
Entity Framework Interview Questions PDF By ScholarHat
PPT
ArcReady - Architecting For The Cloud
PDF
.NET Core, ASP.NET Core Course, Session 13
PPT
Build Business Web Applications with PHPOpenbiz Framework and Cubi Platform
PPTX
Real World API Design Using The Entity Framework Services
PPTX
Microsoft Data Access Technologies
PPTX
Best of Microsoft Dev Camp 2015
DOCX
SAP BO ONLINE TRAINING
DOC
PayaPal-Resume
Building nTier Applications with Entity Framework Services (Part 1)
Entity framework
Programming is Fun with ASP.NET MVC
70487.pdf
Ado.net entity framework_4.0
What's New for Data?
ASP.NET Core Interview Questions PDF By ScholarHat.pdf
Entity Core with Core Microservices.pptx
ADO.NET Entity Framework
Asp.Net Core MVC with Entity Framework
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Entity Framework Interview Questions PDF By ScholarHat
ArcReady - Architecting For The Cloud
.NET Core, ASP.NET Core Course, Session 13
Build Business Web Applications with PHPOpenbiz Framework and Cubi Platform
Real World API Design Using The Entity Framework Services
Microsoft Data Access Technologies
Best of Microsoft Dev Camp 2015
SAP BO ONLINE TRAINING
PayaPal-Resume

More from David McCarter (14)

PPTX
Röck Yoür Technical Interview - V3
PPTX
Rock Your Code With Code Contracts -2013
PPTX
Rock Your Code with Code Contracts
PDF
.NET Coding Standards For The Real World (2012)
PPTX
Back-2-Basics: Code Contracts
PPTX
Back-2-Basics: .NET Coding Standards For The Real World (2011)
PPTX
How To Survive The Technical Interview
PPTX
Code Easier With Visual Studio 2010 & Extensions
PPTX
Back-2-Basics: Exception & Event Instrumentation in .NET
PPTX
Building nTier Applications with Entity Framework Services (Part 2)
PPTX
Back-2-Basics: .NET Coding Standards For The Real World
PPTX
Back-2-Basics: Exception & Event Instrumentation in .NET
PPTX
Back-2-Basics: .NET Coding Standards For The Real World
PPTX
Building nTier Applications with Entity Framework Services (Part 2)
Röck Yoür Technical Interview - V3
Rock Your Code With Code Contracts -2013
Rock Your Code with Code Contracts
.NET Coding Standards For The Real World (2012)
Back-2-Basics: Code Contracts
Back-2-Basics: .NET Coding Standards For The Real World (2011)
How To Survive The Technical Interview
Code Easier With Visual Studio 2010 & Extensions
Back-2-Basics: Exception & Event Instrumentation in .NET
Building nTier Applications with Entity Framework Services (Part 2)
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: Exception & Event Instrumentation in .NET
Back-2-Basics: .NET Coding Standards For The Real World
Building nTier Applications with Entity Framework Services (Part 2)

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation theory and applications.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
Tartificialntelligence_presentation.pptx
PDF
Empathic Computing: Creating Shared Understanding
Electronic commerce courselecture one. Pdf
cuic standard and advanced reporting.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation theory and applications.pdf
20250228 LYD VKU AI Blended-Learning.pptx
NewMind AI Weekly Chronicles - August'25-Week II
“AI and Expert System Decision Support & Business Intelligence Systems”
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Advanced methodologies resolving dimensionality complications for autism neur...
Encapsulation_ Review paper, used for researhc scholars
Spectral efficient network and resource selection model in 5G networks
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Group 1 Presentation -Planning and Decision Making .pptx
Tartificialntelligence_presentation.pptx
Empathic Computing: Creating Shared Understanding

Building N Tier Applications With Entity Framework Services 2010

  • 1. Building nTier Applications with Entity Framework Services
  • 5. nTier Architecture OverviewModel to create flexible reusable applicationsOnly need to modify or add layers instead of rewriting entire applications over
  • 6. Where’s Your Data Model?Applications Today…Implicitly Contain the Data ModelLogic and Model IntertwinedConceptual MismatchOften encapsulate in a "Data Access Layer"
  • 7. Where’s Your Data Model?What Is Really Needed
  • 8. Applications work with a well Defined Model
  • 10. Declarative mapping between application and storage models
  • 11. No brittle, hard-coded mappingEntity Framework
  • 12. Object Relational MappingWhat is ORM?Technique for working with relational tables as if they were objects in memoryIntention is to hide away the complexity of the underlying tables and give a uniform way of working with dataWhy use ORM?ProductivityRetain database independenceObjectsClassesEntities
  • 13. Object Relational MappingThere are many ORMs for .NET developers already in existence. E.g.LLBLGen Pro http://www.llblgen.com/Nhibernate http://www.hibernate.org/343.htmlEntitySpaces http://www.entityspaces.net/Portal/Default.aspx
  • 14. The Microsoft Entity Data ModelAn extended relational model with Entity-Relationship Model conceptsEntity TypesStrong type with IdentityInheritanceScalar/Complex propertiesEntitySetsHold instances of Entity TypesSimilar to relational tablesCan have multiple Entitysets of the same EntityTypesRelationships ("Associations")Named relationships between Entities0..1:*, 0..1:0..1, 1:1, 1:M, M:NNavigation may be exposed as NavigationProperties on EntityTypesAssociationSetsContains instances of associationsMay be queried directlyEntityContainersContains EntitySets, AssociationSetsSalesPersonEmployeeID = 294272LoginID = adamTitle = "Dev Lead"VacationHours = 0…Manager11NReportsSalesPersonSalesPersonEmployeeID = 729742LoginID = peteTitle = "Developer"VacationHours = 0…ExpenseAccount = …CarLicenseNum = ……SalesPersonEmployeeID = 729742LoginID = peteTitle = "Developer"VacationHours = 0…ExpenseAccount = …CarLicenseNum = ……EmployeeID = 729742LoginID = peteTitle = "Developer"VacationHours = 0…ExpenseAccount = true…
  • 15. EDM & Entity Framework?The Entity Framework (EF) is an Object Relational Modeling tool leveraging the EDMFocus 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.
  • 17. EF Providers in Progress
  • 18. LINQ to Entities – Lots of Topics
  • 20. Using Entity Framework with ASP.NET
  • 21. Pain Points in v3.5 SP1Pluralization/ SingularizationForeign KeysModel FirstLazy LoadingAdditional LINQ OperatorsL2S Features & PatternsSQL Gen Improvements
  • 22. Entity Framework in .NET 4Improvements:Model FirstT4 Templates to control code generationSupporting DDD approach with POCO Persistence IgnoranceRepository patternQuery ImprovementsLazy LoadingDisconnected API’s to enable N-tier
  • 23. Easily Expose Your EntitiesWCF Data Services
  • 24. Data Services OverviewExtends Windows Communication FoundationFunctionalityCRUD access to data over RESTful web servicesBuilt-in URI-based query syntaxClient-side libraries for .NET and AJAX clients
  • 25. Data ServicesHTTPOpen Data ProtocolHosting/HTTP ListenerData Services RuntimeIQueryable/IEnumerable[+ IUpdatable]Data Access LayerEntity FrameworkCustom LINQ ProviderRelational databaseOther sources
  • 26. Data Services - A REST InterfaceThe underlying model
  • 27. Entities and associations  resources and linksWCF 4Programming ModelCore ServicesWeb HTTP ServicesData ServicesRIA ServicesWorkflow ServicesService ModelData ContractService ContractService BehaviorChannel ModelFormats(Atom, JSON, XML,…)Transports(HTTP, TCP, …)Protocols(SOAP, HTTP, Open Data Protocol,…)
  • 28. URL ConventionsAddressing entities and setsPresentation optionsModern Data-Driven Web AppsAJAX integrationAJAX-friendly JSON format in servicesJavascript library that integrates with the ASP.NET AJAX toolkitSilverlight support.NET programming model for data servicesObject based, LINQ enabled APICode-gen entity types from metadata
  • 29. "Traditional" ApplicationsWeb applicationsData services client can be used in ASP.NETASP.NET data source control for accessing remote servicesDesktop applicationsFully-featured .NET client librarySame API in desktop and Silverlight environments
  • 30. What’s New in .NET 4Data BindingNew DataServiceCollection class provides simplified binding of data service data to (WPF) controls. Includes auto updating.Counting Entities in an Set $count - total number of resources returned by a URI$inlinecount - total resource count together with the resource dataServer-driven Paging Service can be configured to return requested resources as a set of paged responses
  • 31. What’s New in .NET 4Query ProjectionsQuery results can be modified to include only a subset of properties by using the new $select query option.Custom Data Service ProvidersCan implement a set of new data service provider interfaces, you can use various types of data with a data service, even when the data model changes during execution.Streaming of Binary ResourcesThis enables you to retrieve and save binary large object data independent of the entity to which it belongs.
  • 35. Before You Begin…What I Have Learned So Far About The Entity Framework and ADO.NET Data Serviceshttp://dotnettips.com/2008/09/30/WhatIHaveLearnedSoFarAboutTheEntityFrameworkAndADONETDataServices.aspx*Part 2 coming out soon!Using Microsoft ADO.NET Data Serviceshttp://msdn.microsoft.com/en-us/library/cc907912.aspx
  • 36. ResourcesADO.NET Team Bloghttp://blogs.msdn.com/adonet/default.aspxEF Design Blogblogs.msdn.com/efdesignVisual Studio Data Bloghttp://blogs.msdn.com/vsdata/dnrTV!http://shrinkster.com/1734http://shrinkster.com/1735
  • 37. ResourcesDan Simmons Bloghttp://blogs.msdn.com/dsimmons/MSDN Code Galleryhttp://shrinkster.com/1733WCF Data Services Learning Guide:http://msdn.microsoft.com/en-us/data/bb931106.aspxWCF Data Services Team Bloghttp://blogs.msdn.com/astoriateam/default.aspx

Editor's Notes

  • #5: Goals:To show a new way of serving up dateGet you thinking to learn more when you leave this presentation
  • #6: How do you or have you designed your applications??? Be truthful!!N-tier application architecture provides a model for developers to create a flexible and reusable application. By breaking up an application into tiers, developers only have to modify or add a specific layer, rather than have to rewrite the entire application over, if they decide to change technologies or scale up. In the term "N-tier," "N" implies any number -- like 2-tier, or 4-tier; basically, any number of distinct tiers used in your architecture. Application architectures are part of Layer 7 of the OSI model.
  • #10: Talk about the separation between database developer and programmer.
  • #11: Talk about the separation between database developer and programmer.
  • #13: Applications can work in terms of a more application-centric conceptual model, including types with inheritance, complex members, and relationships.Applications are freed from hard-coded dependencies on a particular data engine or storage schema.Mappings between the conceptual model and the storage-specific schema can change without changing the application code.Developers can work with a consistent application object model that can be mapped to various storage schemas, possibly implemented in different database management systems.Multiple conceptual models can be mapped to a single storage schema.Language-integrated query (LINQ) support provides compile-time syntax validation for queries against a conceptual model.
  • #16: POCO = Plane Old .NET Classes
  • #17: Demo: AdventureWorks.DataDemo: AdvertureWorks.ExampleDemo: EntityDesignerDiagram.png
  • #18: AdventureWorks.AdminAdd entity referenceAdd Reference to System.Data.EntityAdd connection string to web.configShow ProductCategories table.
  • #23: Talk about any object can be exposed via EF!
  • #31: Demo: AdvertureWorksServiceDemo: AdventureWorks.Client