Entity Framework - Architecture


Following are the architecture of Entity Framework, from the bottom up −

ADO.Net Data Provider

These are source specific providers, which abstract the ADO.NET interfaces to connect to the database when programming against the conceptual schema. It translates the SQL languages such as LINQ via command tree to SQL expression and executes it against the specific DBMS system.

Entity Client Data Provider

This layer exposes the entity layer to the upper layer. Entity client provides the ability for engineers to work against entities in the form of rows and columns using entity SQL queries without the need to generate classes to represent conceptual schema. Entity Client shows the entity framework layers, which are the core functionality. These layers are called as Entity Data Model.

Entity Data Model (EDM): EDM consists of three main parts - Conceptual model, Mapping and Storage model.

Conceptual Model: The conceptual model contains the model classes(entities) and their relationships. This will be independent from database table design.

Storage Model: The Storage model is the database design model which includes tables, views, stored procedures, and their relationships and keys. The Storage model contains the entire database schema in XML format.

Mapping Layer: The Mapping layer is an XML file that maps the entities and relationships defined at conceptual layer with actual relationships and tables defined at logical layer.

Object Service: Object service is a main entry point for accessing data from the database and to return it back. Object service is responsible for materialization, which is the process of converting data returned from an entity client data provider (next layer) to an entity object structure.

         1. The main use of the Object Context is to perform different operations like add, delete instances of entities and to save the changed state back to the database with the help of queries.

         2. It is the ORM layer of Entity Framework, which represents the data result to the object instances of entities.

         3. This services allow developer to use some of the rich ORM features like primary key mapping, change tracking, etc. by writing queries using LINQ and Entity SQL.

LINQ to Entities: LINQ to Entities is a query language used to write queries against the object model. It returns entities, which are defined in the conceptual model.

Entity SQL: Entity SQL is another query language just like LINQ to Entities. It is a little more difficult than L2E and the engineer will have to learn it separately.

Metadata Services: The Metadata services represented in Entity Client provides centralized API to access metadata stored Entity, Mapping and Storage layers.

Praesent mattis

Pellentesque viverra vulputate enim. Aliquam erat volutpat. Pellentesque tristique ante ut risus. Quisque dictum. Integer nisl risus, sagittis convallis, rutrum id, elementum congue, nibh. Suspendisse dictum porta lectus. Donec placerat odio vel elit.

Read More