• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Building nTier Applications with Entity Framework Services (Part 1)
 

Building nTier Applications with Entity Framework Services (Part 1)

on

  • 2,688 views

Learn how to build real world nTier applications with the new Entity Framework and related services. With this new technology built into .NET, you can easily wrap an object model around your database ...

Learn how to build real world nTier applications with the new Entity Framework and related services. With this new technology built into .NET, you can easily wrap an object model around your database and have all the data access automatically generated or use your own stored procedures and views. The session will demonstrate how to create and consume these new technologies from the ground up and focus on database modeling including views and stored procedures along with coding against the model via LINQ. Dynamic data website will also be demonstrated.

Statistics

Views

Total Views
2,688
Views on SlideShare
2,683
Embed Views
5

Actions

Likes
0
Downloads
40
Comments
0

2 Embeds 5

http://speakerrate.com 3
http://www.linkedin.com 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Goals:To show a new way of serving up dateGet you thinking to learn more when you leave this presentation
  • 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.
  • Talk about the separation between database developer and programmer.
  • Talk about the separation between database developer and programmer.
  • 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.
  • POCO = Plane Old .NET Classes
  • Demo: AdventureWorks.DataDemo: AdvertureWorks.ExampleDemo: EntityDesignerDiagram.png
  • Demo: AdventureWorks.DataDemo: AdvertureWorks.ExampleDemo: EntityDesignerDiagram.png

Building nTier Applications with Entity Framework Services (Part 1) Building nTier Applications with Entity Framework Services (Part 1) Presentation Transcript

  • Building nTier Applications with Entity Framework ServicesPart 1
  • Check Out Your Local User Groups!
    San Diego Cloud Computing User Group
    www.azureusergroup.com/group/sandiegoazureusergroup
    San Diego .NET Developers Group
    www.sddotnetdg.org
    San Diego .NET User Group
    www.sandiegodotnet.com
    San Diego SQL Server User Group
    www.sdsqlug.org
  • Win Free Software!
    Rules
    Provide your business card (or email and name)*
    Indicate on the back what software you are interested in
    Otherwise 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)
    Prizes
    CodeRush 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 Overview
    Model to create flexible reusable applications
    Only need to modify or add layers instead of rewriting entire applications over
  • User Experience
    Security
    Active Directory, Card Space, Windows Identity Foundation
    UI Components
    Windows Forms, Windows Presentation Foundation, ASP.NET (AJAX, MVC), Silverlight, Windows Mobile
    Presentation Layer
    Local Storage/ Cache
    Communications Layer
    Windows Communication Foundation (WCF), WCF Data Services, Web Services, Sync Services, Azure (Cloud), RIA Services, Workflow Services
    Business Layer
    Business Entities
    T4 Templates
    Business Components
    Business Workflow
    Windows Workflow Foundation
    Data Layer
    Entity Framework, LINQ to SQL, DataSets
    SQL Server
  • Entity Framework
  • Object Relational Mapping
    What is ORM?
    Technique for working with relational tables as if they were objects in memory
    Intention is to hide away the complexity of the underlying tables and give a uniform way of working with data
    Why use ORM?
    Productivity
    Retain database independence
    ObjectsClassesEntities
  • Object Relational Mapping
    It’s nothing new, just new to .NET
    There are many ORMs for .NET developers already in existence. E.g.
    LLBLGen Pro http://www.llblgen.com/
    Nhibernate http://www.hibernate.org/343.html
    EntitySpaces http://www.entityspaces.net/Portal/Default.aspx
  • The Microsoft Entity Data Model
    An extended relational model with Entity-Relationship Model concepts
    Entity Types
    Strong type with Identity
    Inheritance
    Scalar/Complex properties
    EntitySets
    Hold instances of Entity Types
    Similar to relational tables
    Can have multiple Entitysets of the same EntityTypes
    Relationships ("Associations")
    Named relationships between Entities
    0..1:*, 0..1:0..1, 1:1, 1:M, M:N
    Navigation may be exposed as NavigationProperties on EntityTypes
    AssociationSets
    Contains instances of associations
    May be queried directly
    EntityContainers
    Contains EntitySets, AssociationSets
    SalesPerson
    EmployeeID = 294272LoginID = adamTitle = "Dev Lead"VacationHours = 0…
    Manager
    1
    1
    N
    Reports
    SalesPerson
    SalesPerson
    EmployeeID = 729742LoginID = peteTitle = "Developer"VacationHours = 0…ExpenseAccount = …CarLicenseNum = ……
    SalesPerson
    EmployeeID = 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 EDM
    Focus 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
  • Pain Points in v3.5 SP1
    Pluralization/ Singularization
    Foreign Keys
    Model First
    Lazy Loading
    Additional LINQ Operators
    L2S Features & Patterns
    SQL Gen Improvements
  • Fixing the Paint Points in EF1
    Advanced/ New Features
  • Model First
    Create 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 files
    Creates SQL Server, SQL Server Express, SQL Server Compact database scripts.
  • Lazy Loading
    Enables retrieving all related data (without asking for it)
    Off by default
    Settable on the ContextOptions
    Good for doing reporting!
    Not great for going across services
    Dim ctx As New AdventureWorksLT_DataEntities()
    ctx.ContextOptions.LazyLoadingEnabled = True
  • T4 Templates
    Override default EF classes to create…
    POCO Entity Generator
    Better for going over RESTful service layers
    Self-Tracking Entity Generator
    Better for server/ client local storage.
    Auto generates classes when models change!
    Or can be run manually.
    Easily modifiable for your own needs
    Once you learn the T4 scripting language.
  • Summary
  • Conclusion
  • Resources
    ADO.NET Team Blog
    http://blogs.msdn.com/adonet/default.aspx
    EF Design Blog
    blogs.msdn.com/efdesign
    Visual Studio Data Blog
    http://blogs.msdn.com/vsdata/
    dnrTV!
    http://shrinkster.com/1734
    http://shrinkster.com/1735
  • Resources
    Dan Simmons Blog
    http://blogs.msdn.com/dsimmons/
    MSDN Code Gallery
    http://shrinkster.com/1733
    WCF Data Services Learning Guide:
    http://msdn.microsoft.com/en-us/data/bb931106.aspx
    WCF Data Services Team Blog
    http://blogs.msdn.com/astoriateam/default.aspx
  • Required Book!
    EF4 In Aug 2010