Posts Tagged ‘EDM’

Entity Framework – Microsoft’s Step Towards ORM Building

Saturday, June 19th, 2010

Whenever we develop a new application, lots of things play key role to decide application architecture. Among these, database interaction is the major. In earlier days of .NET 2.0, no significant tools were available from Microsoft to create data access layer for database interaction. People had to use third party utilities for conceptual data modeling over the physical database.

Realizing this need Microsoft introduced LINQ to SQL for conceptual data modeling, though it comes with limited set of functionalities and can be used by SQL Server database only. To overcome this situation, Microsoft has taken steps to release new feature called Entity Framework with ADO.NET 3.5 SP1 release.

ADO.NET Entity Framework is an Object – Relational Mapping (ORM) framework. It builds on the concept of Entity Relationship Model by introducing a conceptual model, called the Entity Data Model (EDM) which sits between your code and the underlying schema (database). This abstraction helps a lot to reduce the efforts as well the complexity for moving relational data to object oriented programming.

Entity Framework architecture:

Here is how the Entity Framework is layered to abstract the relational schema of a database and present a conceptual model.

Entity Framework Architecture
  • Data Source: It represents one or many databases.
  • ADO.NET Data Providers: It will access data from data source.
  • Entity Data Model (EDM): EDM contains entity classes, storage container and mapping of the entity with the table.
  • Entity Client: It is an ADO.NET managed provider that supports accessing data described in an EDM.
  • Object Services: This component enables you to query, insert, update, and delete data, expressed as strongly typed CLR objects that are instances of entity types.
  • Entity SQL (ESQL): It is a derivative of Transact-SQL, designed to query and manipulate entities. Both Object Services and Entity Client components can execute Entity SQL statements.
  • LINQ to Entities: It is used to query against entities defined in the EDM.

Advantages:

  • You can use the Entity Framework against not only SQL Server but also Oracle, DB2, Informix, MySQL, Postgres etc with the help of its data providers.
  • You can create data access layer with the ease of Entity Framework wizards. Developer can work with data rather than coding against rows and columns.
  • It is truly a foundation stone for Microsoft’s data access platform. one of the use of this platform  is REST based ADO.NET data service aka Astoria.

How to build: (more…)