神刀安全网

Entity Framework Architecture

In this article, we will discuss the Entity Framework Architecture

The ADO.NET Entity Framework is comprised of the following components:

  • The Entity Data Model
  • LINQ to Entities
  • Entity Client
  • Entity SQL
  • The Object Services Layer

Entity Framework Architecture

The Entity Data Model

The Entity Data Model abstracts the logical or the relational schema and exposes the conceptual schema of the data using a three-layered approach.

  • The Conceptual Model (C-Space)
  • The Mapping Model(C-S Space)
  • The Store Model (S-Space)

Conceptual Model:

The conceptual model contains the entities and their relationships. This will be independent from your database table design.

It defines your business objects and their relationships in XML files.

Mapping Model:

Mapping consists of information about how the conceptual model is mapped to the storage model.Mapping model is responsible for mapping the conceptual and the logical layers. It maps the business objects and the relationships defined in the conceptual layer with the tables and relationships defined in the logical layer

Storage/Logical Model:

It represents the schema of the underlying database. This is comprised of tables, stored procedures, view,

and functions.

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 Client:

The main responsibility of this layer is to convert L2E or Entity SQL queries into a SQL query which is understood by the underlying database. It communicates with the ADO.Net data provider which in turn sends or retrieves data from the database.

Entity client provides the ability for developers 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 SQL:

Entity SQL is another query language just like LINQ to Entities. These E-SQL queries are internally translated to data store dependent SQL queries. The conversion of the E-SQL queries to their data store-specific query language like T-SQL, is handled by the Entity Framework.

Object Services Layer:

Apart from querying the Conceptual Model, you might have to work with entities such as in-memory objects or a collection of in-memory objects. To do this you need Object Services.You can use it to query data, from almost any data store, with less code. In addition to from enabling you to perform CRUD operations,the Object Services Layer provides the following additional services:

  • Change tracking
  • Lazy loading
  • Inheritance
  • Optimistic concurrency
  • Merging data
  • Identity resolution
  • Support for querying data using Entity SQL and LINQ to Entities

We will discuss on Object services Layer in detail, in next articles.

Thanks for visiting !!

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Entity Framework Architecture

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮