.NET Database Technologies:

Slides:



Advertisements
Similar presentations
Three-Step Database Design
Advertisements

Michael Pizzo Software Architect Data Programmability Microsoft Corporation.
Object Relational Mapping – ORM Entity Framework
.NET Database Technologies: Open-Source Frameworks.
Discover, Master, InfluenceSlide 1 SQL Server Compact Edition and the Entity Framework Rob Sanders Readify.
Introduction to ADO Entity Framework ir Denis VOITURON Source:
Entity Framework Code First End to End
.NET Database Technologies: Entity Framework additional notes – part 2.
Entity Framework, a quickstart Florin−Tudor Cristea, Microsoft Student Partner.
Visual Studio 2010 and.NET Framework 4 Training Workshop.
Intro to C#.net and EF Ilan Shimshoni. The Three Faces of ADO.NET The connected layer – Directly connecting to the DB The disconnected layer – Using datasets.
Entity Framework Overview. Entity Framework A set of technologies in ADO.NET that support the development of data-oriented software applications A component.
Object Oriented Analysis and Design 1 Chapter 7 Database Design  UML Specification for Data Modeling  The Relational Data Model and Object Model  Persistence.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
UNIT 2.
1 Mapping to Relational Databases Presented by Ramona Su.
44220: Database Design & Implementation Modelling the ‘Real’ World Ian Perry Room: C41C Ext.: 7287
Entity Framework Code First – Beyond the Basics Sergey Barskiy, Magenic Microsoft MVP – Data Platform Principal Consultant.
Oct * Brad Tutterow. VS 2008.NET 3.5LINQ Entity Framework  The ADO.NET Entity Framework is part of Microsoft’s next generation of.NET technologies.
EntityFrame work and LINQ CH 14. linq LINQ enables you to query data from a wide variety of data sources, directly from your programming code. LINQ is.
Understanding Data Intensive Systems Using Dynamic Analysis and Visualization Nesrine NOUGHI.
Entity Framework Code First – Beyond the Basics Sergey Barskiy, Magenic Microsoft MVP – Data Platform Magenic, Principal Consultant Level: Introductory.
Class Diagrams. Terms and Concepts A class diagram is a diagram that shows a set of classes, interfaces, and collaborations and their relationships.
ADO.NET 3.0 – Entity Data Model Gert E.R. Drapers Chief Software Architect Visual Studio Team Edition for Database Professionals Microsoft Corporation.
1 © 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Geographic Information Systems GIS Data Databases.
COP Introduction to Database Structures
Neo4j: GRAPH DATABASE 27 March, 2017
Databases and DBMSs Todd S. Bacastow January
Database Systems: Design, Implementation, and Management Tenth Edition
New Technology: Why, What ,How
Logical Database Design and the Rational Model
Model In MVC Mo Rezai.
Introduction to Entity Framework
Business System Development
EF Relations Object Composition
Enhanced Entity-Relationship (EER) Modeling
Entity Framework: Relations
Databases Chapter 16.
Relational Databases.
 .NET CORE
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
Chapter 7: Entity-Relationship Model
Databases and Database Management Systems Chapter 9
Outline of the ER Model By S.Saha
Entity Framework By: Casey Griffin.
Geographic Information Systems
Conceptual data modeling
Learn. Imagine. Build. .NET Conf
Geo-Databases: lecture 7 Database design
ADO.NET Entity Framework Marcus Tillett
ADO.NET Entity Framework
Seminar 9: OODB Design (Self Study)
Advanced Database Models
ADO.NEXT Advances in Data Access for 2008
Chapter 2 Database Environment.
Chapter 4 Entity Relationship (ER) Modeling
Data Model.
Analysis models and design models
Adding Multiple Logical Table Sources
logical design for relational database
Chapter 4 Entity Relationship (ER) Modeling
Software Analysis.
Object-Oriented PHP (1)
ADO.NET Entity Framework
Entity-Relationship Modelling
Software Development Process Using UML Recap
Visual Studio 2010 and .NET Framework 4 Training Workshop
Geographic Information Systems
Presentation transcript:

.NET Database Technologies: Entity Framework additional notes – part 1

“Making the conceptual level real” (Blakeley, 2006) Raises the level of abstraction from the logical (relational) level to the conceptual (entity) level Provides a data model that can define the structure essence of entities Entities and relationships as first-class objects Provides a concrete representation that allows us to manipulate data at this level Entity Data Model (EDM) – relates to Entity Relationship Model (Chen, 1976) The EDM is a value-based conceptual model - it does not incorporate behaviours of any kind Compare with UML, which expresses a conceptual model incorporating behaviour

Using an EDM EDM consists of: Conceptual model Logical model (storage in relational database) Mapping between these EDM can be used to generate C# (or VB) classes which can be used in an application EF provides services for queries which work with C# objects EF manages mappings from database data to object properties

Benefits of using an EDM Data model in application is not tied to database schema EDM allows developer to shape the data to suit the application, not the database Database may be a shared or legacy db which cannot be modified by application developer Normalisation or other optimisations in db may produce schema which does not match the application well Compare with Linq to SQL, which is (essentially) designed to allow strongly typed querying of relational database

So, it’s an ORM then? EF v1 allows building EDM by generating from database and manipulating in EDM Designer Allows building of EDM and configuring mapping to databases In both cases, EDM Designer generates code to represent data model in application Not intended to take existing domain model and map to relational database Not really an ORM, although it has many of the characteristics of one EF v4 moves significantly towards being an ORM

EF v1 and persistence ignorance EF v1 entity classes require a number of non-PI features, including: Inherit from a certain base class - EntityObject Only instantiate via a provided factory Use specially provided datatypes, such as for collections - EntityCollection Not PI!

EDM Mappings - Basic Map entities directly to tables EDM has navigation properties Can rename properties, exclude properties as required

EDM Mappings – Table Splitting Two entities map onto the same table Entities have one-to-one relationship http://thedatafarm.com/blog/data-access/ef-table-splitting-ndash-the-opposite-of-entity-splitting/

EDM Mappings – Inheritance (Table per Hierarchy) Base class and derived classes all map to the same table Discriminator field indicates which type to instantiate

EDM Mappings – Entity Splitting One entity maps onto two separate tables Tables must share a common key Can access all properties in code without using navigation properties

EDM Mappings – Inheritance (Table per Type) Base class and derived classes map to the separate tables Tables must share a common key

EDM Mappings – Complex Types Refactor set of properties of an entity to a complex type Can use complex type in other entities Complex type can only be persisted as part of an entity