SlideShare a Scribd company logo
Building nTier Applications with Entity Framework ServicesPart 1
Building nTier Applications with Entity Framework Services (Part 1)
Check Out Your Local User Groups!San Diego Cloud Computing User Groupwww.azureusergroup.com/group/sandiegoazureusergroupSan Diego .NET Developers Groupwww.sddotnetdg.orgSan Diego .NET User Groupwww.sandiegodotnet.comSan Diego SQL Server User Groupwww.sdsqlug.org
Win Free Software!RulesProvide your business card (or email and name)*Indicate on the back what software you are interested inOtherwise I will pick Winners will be picked next week*Yes, most likely I’m going to send you and email about my user group (sddotnetdg.org) and or web site (dotNetTips.com)PrizesCodeRush and Refactor Pro from DevExpress (4)SecondCopy (automatic backup software) (5) *CodeIt.Right Standard from SubMain (4)*Requires mailing address and phone number
Agenda
Overview
nTier Architecture OverviewModel to create flexible reusable applicationsOnly need to modify or add layers instead of rewriting entire applications over
User ExperienceSecurityActive Directory, Card Space,  Windows Identity FoundationUI ComponentsWindows Forms, Windows Presentation Foundation, ASP.NET (AJAX, MVC), Silverlight, Windows MobilePresentation LayerLocal Storage/ CacheCommunications LayerWindows Communication Foundation (WCF), WCF Data Services, Web Services, Sync Services, Azure (Cloud), RIA Services, Workflow ServicesBusiness LayerBusiness EntitiesT4 TemplatesBusiness ComponentsBusiness WorkflowWindows Workflow FoundationData LayerEntity Framework, LINQ to SQL, DataSetsSQL Server
Entity 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 MappingIt’s nothing new, just new to .NETThere 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 nTier Applications with Entity Framework Services (Part 1)
Pain Points in v3.5 SP1Pluralization/ SingularizationForeign KeysModel FirstLazy LoadingAdditional LINQ OperatorsL2S Features & PatternsSQL Gen Improvements
Fixing the Paint Points in EF1Advanced/ New Features
Model FirstCreate your conceptual model first (not from an existing database)Wizard will allow the creation of sql scripts to create database scripts.Also will create EDM filesCreates SQL Server, SQL Server Express, SQL Server Compact database scripts.
Lazy LoadingEnables retrieving all related data (without asking for it)Off by defaultSettable on the ContextOptionsGood for doing reporting!Not great for going across services Dim ctx As New AdventureWorksLT_DataEntities()ctx.ContextOptions.LazyLoadingEnabled = True
T4 TemplatesOverride default EF classes to create…POCO Entity GeneratorBetter for going over RESTful service layersSelf-Tracking Entity GeneratorBetter for server/ client local storage.Auto generates classes when models change!Or can be run manually.Easily modifiable for your own needsOnce you learn the T4 scripting language.
Building nTier Applications with Entity Framework Services (Part 1)
Summary
Conclusion
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
Required Book!EF4 In Aug 2010

More Related Content

PPTX
Building nTier Applications with Entity Framework Services
PPTX
Building nTier Applications with Entity Framework Services (Part 2)
PPTX
Back-2-Basics: .NET Coding Standards For The Real World
PPTX
Introducing Entity Framework 4.0
PPTX
Entity framework and how to use it
PPTX
Entity Framework Database and Code First
PDF
Learn Entity Framework in a day with Code First, Model First and Database First
PPTX
Entity Framework Overview
Building nTier Applications with Entity Framework Services
Building nTier Applications with Entity Framework Services (Part 2)
Back-2-Basics: .NET Coding Standards For The Real World
Introducing Entity Framework 4.0
Entity framework and how to use it
Entity Framework Database and Code First
Learn Entity Framework in a day with Code First, Model First and Database First
Entity Framework Overview

What's hot (20)

PPTX
Getting started with entity framework
PPTX
Entity Framework v2 Best Practices
PPTX
Building nTier Applications with Entity Framework Services (Part 1)
PPTX
Entity Framework
PPT
Entity framework 4.0
PPTX
Ef code first
PPTX
Entity Framework: Code First and Magic Unicorns
PPTX
Entity framework code first
PPTX
ADO.NET Data Services & Entity Framework
PPTX
Microsoft Entity Framework
KEY
Introducing the Entity Framework
PPTX
Entity framework
PPTX
Building nTier Applications with Entity Framework Services (Part 2)
PPT
ADO.NET Entity Framework
PDF
Advanced Core Data
PPTX
Play With Windows Phone Local Database
PPTX
Using MongoDB with the .Net Framework
PPT
Entity Framework Overview
PPTX
Building Windows Phone Database App Using MVVM Pattern
PPTX
Microsoft SQL Server 2008
Getting started with entity framework
Entity Framework v2 Best Practices
Building nTier Applications with Entity Framework Services (Part 1)
Entity Framework
Entity framework 4.0
Ef code first
Entity Framework: Code First and Magic Unicorns
Entity framework code first
ADO.NET Data Services & Entity Framework
Microsoft Entity Framework
Introducing the Entity Framework
Entity framework
Building nTier Applications with Entity Framework Services (Part 2)
ADO.NET Entity Framework
Advanced Core Data
Play With Windows Phone Local Database
Using MongoDB with the .Net Framework
Entity Framework Overview
Building Windows Phone Database App Using MVVM Pattern
Microsoft SQL Server 2008
Ad

Similar to Building nTier Applications with Entity Framework Services (Part 1) (20)

PPTX
Entity Framework V1 and V2
PPTX
Entity Framework v1 and v2
PPT
What's New for Data?
PDF
Entity Framework Interview Questions PDF By ScholarHat
PPTX
Building N Tier Applications With Entity Framework Services 2010
PPT
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
PPT
Linq To The Enterprise
PDF
70487.pdf
PPT
Linq 1224887336792847 9
PPTX
Domain oriented development
PPT
ADO.NET Entity Framework
PDF
Dot Net Fundamentals
PPTX
Developing Actors in Azure with .net
PDF
Elements of DDD with ASP.NET MVC & Entity Framework Code First
PPTX
Entity framework
DOCX
Entity Framework
PPT
Introduction to Visual Studio.NET
PPTX
Entity framework
PPTX
Entity framework introduction sesion-1
PPTX
Entity Framework 4
Entity Framework V1 and V2
Entity Framework v1 and v2
What's New for Data?
Entity Framework Interview Questions PDF By ScholarHat
Building N Tier Applications With Entity Framework Services 2010
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
Linq To The Enterprise
70487.pdf
Linq 1224887336792847 9
Domain oriented development
ADO.NET Entity Framework
Dot Net Fundamentals
Developing Actors in Azure with .net
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Entity framework
Entity Framework
Introduction to Visual Studio.NET
Entity framework
Entity framework introduction sesion-1
Entity Framework 4
Ad

More from David McCarter (12)

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
Real World API Design Using The Entity Framework Services
PPTX
Code Easier With Visual Studio 2010 & Extensions
PPTX
Back-2-Basics: Exception & Event Instrumentation in .NET
PPTX
Back-2-Basics: .NET Coding Standards For The Real World
PPTX
Back-2-Basics: Exception & Event Instrumentation in .NET
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
Real World API Design Using The Entity Framework Services
Code Easier With Visual Studio 2010 & Extensions
Back-2-Basics: Exception & Event Instrumentation in .NET
Back-2-Basics: .NET Coding Standards For The Real World
Back-2-Basics: Exception & Event Instrumentation in .NET

Recently uploaded (20)

PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
PDF
creating-agentic-ai-solutions-leveraging-aws.pdf
PDF
How AI Agents Improve Data Accuracy and Consistency in Due Diligence.pdf
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
Sensors and Actuators in IoT Systems using pdf
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
KodekX | Application Modernization Development
PDF
Modernizing your data center with Dell and AMD
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Belt and Road Supply Chain Finance Blockchain Solution
PDF
DevOps & Developer Experience Summer BBQ
PDF
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Web Security: Login Bypass, SQLi, CSRF & XSS.pptx
PDF
Top Generative AI Tools for Patent Drafting in 2025.pdf
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
PDF
Transforming Manufacturing operations through Intelligent Integrations
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
creating-agentic-ai-solutions-leveraging-aws.pdf
How AI Agents Improve Data Accuracy and Consistency in Due Diligence.pdf
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Sensors and Actuators in IoT Systems using pdf
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
KodekX | Application Modernization Development
Modernizing your data center with Dell and AMD
A Day in the Life of Location Data - Turning Where into How.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Belt and Road Supply Chain Finance Blockchain Solution
DevOps & Developer Experience Summer BBQ
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Web Security: Login Bypass, SQLi, CSRF & XSS.pptx
Top Generative AI Tools for Patent Drafting in 2025.pdf
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Transforming Manufacturing operations through Intelligent Integrations

Building nTier Applications with Entity Framework Services (Part 1)

  • 1. Building nTier Applications with Entity Framework ServicesPart 1
  • 3. Check Out Your Local User Groups!San Diego Cloud Computing User Groupwww.azureusergroup.com/group/sandiegoazureusergroupSan Diego .NET Developers Groupwww.sddotnetdg.orgSan Diego .NET User Groupwww.sandiegodotnet.comSan Diego SQL Server User Groupwww.sdsqlug.org
  • 4. Win Free Software!RulesProvide your business card (or email and name)*Indicate on the back what software you are interested inOtherwise I will pick Winners will be picked next week*Yes, most likely I’m going to send you and email about my user group (sddotnetdg.org) and or web site (dotNetTips.com)PrizesCodeRush and Refactor Pro from DevExpress (4)SecondCopy (automatic backup software) (5) *CodeIt.Right Standard from SubMain (4)*Requires mailing address and phone number
  • 7. nTier Architecture OverviewModel to create flexible reusable applicationsOnly need to modify or add layers instead of rewriting entire applications over
  • 8. User ExperienceSecurityActive Directory, Card Space, Windows Identity FoundationUI ComponentsWindows Forms, Windows Presentation Foundation, ASP.NET (AJAX, MVC), Silverlight, Windows MobilePresentation LayerLocal Storage/ CacheCommunications LayerWindows Communication Foundation (WCF), WCF Data Services, Web Services, Sync Services, Azure (Cloud), RIA Services, Workflow ServicesBusiness LayerBusiness EntitiesT4 TemplatesBusiness ComponentsBusiness WorkflowWindows Workflow FoundationData LayerEntity Framework, LINQ to SQL, DataSetsSQL Server
  • 10. 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
  • 11. Object Relational MappingIt’s nothing new, just new to .NETThere 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
  • 12. 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…
  • 13. 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.
  • 15. EF Providers in Progress
  • 16. LINQ to Entities – Lots of Topics
  • 18. Pain Points in v3.5 SP1Pluralization/ SingularizationForeign KeysModel FirstLazy LoadingAdditional LINQ OperatorsL2S Features & PatternsSQL Gen Improvements
  • 19. Fixing the Paint Points in EF1Advanced/ New Features
  • 20. Model FirstCreate your conceptual model first (not from an existing database)Wizard will allow the creation of sql scripts to create database scripts.Also will create EDM filesCreates SQL Server, SQL Server Express, SQL Server Compact database scripts.
  • 21. Lazy LoadingEnables retrieving all related data (without asking for it)Off by defaultSettable on the ContextOptionsGood for doing reporting!Not great for going across services Dim ctx As New AdventureWorksLT_DataEntities()ctx.ContextOptions.LazyLoadingEnabled = True
  • 22. T4 TemplatesOverride default EF classes to create…POCO Entity GeneratorBetter for going over RESTful service layersSelf-Tracking Entity GeneratorBetter for server/ client local storage.Auto generates classes when models change!Or can be run manually.Easily modifiable for your own needsOnce you learn the T4 scripting language.
  • 26. 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
  • 27. 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

  • #7: Goals:To show a new way of serving up dateGet you thinking to learn more when you leave this presentation
  • #8: 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.
  • #11: Talk about the separation between database developer and programmer.
  • #12: Talk about the separation between database developer and programmer.
  • #14: 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.
  • #17: POCO = Plane Old .NET Classes
  • #18: Demo: AdventureWorks.DataDemo: AdvertureWorks.ExampleDemo: EntityDesignerDiagram.png
  • #22: Demo: AdventureWorks.DataDemo: AdvertureWorks.ExampleDemo: EntityDesignerDiagram.png