Академический Документы
Профессиональный Документы
Культура Документы
A central benefit the Entity Framework is that it frees you from being concerned
with the structure of your database. All of your data access and storage is done
against a conceptual data model that reflects your own business objects.
An Entity Data Model (EDM) is a client-side data model and it is the core of the
Entity Framework. It is not the same as the database model, which belongs to the
database.
.NET is but one tool that uses an EDM. The next version of SQL Server will use an
EDM for Reporting Services and you will soon begin to see other Microsoft
applications that will adopt the EDM concept as well. In fact, you will find that
model-driven development in general is getting more and more attention from
Microsoft.
When working with the Entity Framework, you will implement an EDM that is
particular to the Entity Framework. In the Entity Framework, an EDM is represented
by a single XML file at design time that is split into a set three XML files at runtime,
only one of which represents a conceptual model.
The conceptual data model that the EDM describes is stored in an XML file whose
schema identifies the entities and their properties. Behind the conceptual schema
described in the EDM is another pair of XML files that map your data model back to
the database. One is an XML file that describes your database and other is a file
that provides the mapping between your conceptual model and the database.
The Entity Framework runtimes most prominent feature set and that which you are
likely to work with most often is referred to as Object Services. Object Services sits
on top of the Entity Framework stack, as shown in Figure 1-6, and provides the
functionality needed to work with objects that are based on your entities. Object
Services provides a class called Entity Object and can easily manage any class that
inherits from EntityObject. Object Services also provides serialization (both XML and
binary).
Object Services then uses the change-tracking information when its time to update
the data. It constructs Insert, Update and Delete commands for each object that has
been added, modified or deleted by comparing the original values to the current
values of the entity.
process splits the EDMX out into the three metadata files that are used at runtime.
The Entity Framework then provides a framework that allows developers to
write.NET applications based on this model. As long as the EDM provides the
conceptual schema, a representation of the database, a mapping file, and access to
an Entity Framework-aware ADO.NET provider for the target database, the Entity
Framework doesnt care what database is being targeted. It provides a common
means of interacting with the database, common query syntax, and a common
method for sending changes back to the database.