databasedev.co.uk - database solutions and downloads for microsoft access

ADO.NET

Understanding ADO.NET Entity Framework

This article takes a look at the upcoming ADO.NET Entity Framework, its features and benefits. It also discusses why it promises to be the technology of choice for the next generation of data access using ADO.NET. The primary objective of the ADO.NET Entity Framework is to objectify your application’s data - add a level of abstraction on top of the relational model. In raising this level of abstraction, you can isolate the logical model of your application's data from the relational model.

Why ADO.NET Entity Framework?

ADO.NET Entity Framework (formerly known as ADO.NET vNext), promises to be the technology of choice for the next generation of data access using Microsoft.NET's managed platform. The ADO.NET Entity Framework is actually an extended ORM and you can even use it to query data through strongly typed LINQ. And, you have the ability to use the entity SQL query language as well. The other striking features include, support for entity inheritance, entity composition and change tracking.

In this regard, the MSDN states, “A primary goal of the ADO.NET Entity Framework is to raise the level of abstraction available for data programming, thus simplifying the development of data aware applications and enabling developers to write less code. The Entity Framework is the evolution of ADO.NET that allows developers to program in terms of the standard ADO.NET abstraction or in terms of persistent objects (ORM) and is built upon the standard ADO.NET Provider model which allows access to third party databases.”

Features of the ADO.NET Entity Framework

The following is a list of the salient features of the ADO.NET Entity Framework:

  • The Entity Data Model (EDM) that can be used to provide a layer of abstraction on top of the relational model
  • The Entity SQL query language to query the EDM
  • Support for querying data using LINQ
  • Support for an Object Services Layer
  • Support for entity inheritance, identity resolution and change tracking

The Entity Data Model

The entire concept of the ADO.NET Entity Framework is rests around the Entity Data Model – the core of the ADO.NET Entity Framework. The Entity Data Model is a an Entity Relationship Model – the conceptual view of your application’s data. The ADO.NET Entity Framework makes use of mapping files to isolate your application’s code from any changes in the relational schema. The Entity Data Model is actually the core of the Entity Framework and is responsible for providing the level of abstraction between the relational or the logical model and the object model.

The MSDN states, "The Entity Data Model is an Entity-Relationship data model. The ER model is familiar to most if not all database application developers, and has been used successfully for about 30 years. The central concepts in the EDM are entities and relationships."

To query data against the Entity Data Model (EDM), you can use one of the following:

  • LINQ to Entities
  • Entity SQL
  • Object Services

Features of the ADO.NET Entity Data Model

The EDM is a conceptual model that includes the following features:

  • Structural inheritance
  • Composition
  • Relationships

The Entity Data Model Layers

It is comprised mainly of three layers:

  • CSDL (Conceptual Data Language)
  • SSDL (Store-specific Data Language)
  • MSL (Mapping Schema Language)

Conclusion

The ADO.NET Entity Framework enables you to raise the level of abstraction by isolating your application’s relational model from the object model. Added to what a typical ORM provides, it enables identity resolution, chance tracking, entity inheritance, entity composition, etc. In this article we have had a look at the ADO.NET Entity Framework and the Entity Data Model. To find more information on this technology, refer to my latest book titled "Entity Framework Tutorial" from Packt Publishing.

The Author

Joydip Kanjilal is a Microsoft MVP in ASP.NET.

He has more than 12 years of industry experience in IT with more than six years in Microsoft .NET and its related technologies.

He has authored articles for some of the most reputable sites, including http://www.asptoday.com, http://www.devx.com, http://www.aspalliance.com, http://www.aspnetpro.com, http://www.sql-server-performance.com, and http://www.sswug.com.

Many of these articles have been selected at http://www.asp.net, Microsoft’s official site for ASP.NET. Joydip was also a community credit winner at http://www.community-credit.com a number of times.

He is currently working as a Lead Architect in a reputable company in Hyderabad, India. He has years of experience in designing and architecting solutions for various domains. His technical strengths include, C, C++, VC++, Java, C#, Microsoft .NET, AJAX, Design Patterns, SQL Server, Operating Systems, and Computer Architecture.

Joydip blogs at http://aspadvice.com/blogs/joydip and spends most of his time reading books and blogs, and writing books and articles. His hobbies include watching cricket and soccer and playing chess