What is the Entity Framework?
Writing and managing ADO code for data access is a tedious and monotonous job. Microsoft has provided a O/RM framework called "Entity framework" to automate database related activities for your applic ation.
Microsoft has given the following definition of the Entity Framework:
The Microsoft ADO Entity Framework is an object/relational Mapping (ORM) framework, the enables developers to work wit H relational data as domain-specific objects, eliminating the need for most of the data access plumbing code that develope Rs usually need to write. Using the Entity Framework, developers issue queries using LINQ, then retrieve and manipulate data as strongly typed OBJEC Ts. The Entity Framework ' s ORM implementation provides services like change tracking, identity resolution, lazy loading, and q Uery translation So, developers can focus on their application-specific business logic rather than the data access fun Damentals.
The Entity framework is an object/relational Mapping (O/RM) framework. It is a enhancement to ADO gives developers an automated mechanism for accessing & storing the data in the D Atabase.
The Entity framework is useful in three scenarios. First, if you already has existing database or you want to design your database ahead of other parts of the application. Second, want to focus on your domain classes and then create the database from your domain classes. Third, want to design your database schema on the visual designer and then create the database and classes.
The following figure illustrates the above scenarios.
As per the above figure, EF creates data access classes for your existing database, so it can use these classes to I Nteract with the database instead of ADO directly.
EF can also create the database from your domain classes, thus your can focus on your domain-driven design.
EF provides you a model designer where can design your DB model and then EF creates database and classes based on your DB model.
What is O/RM?
ORM is a tool for storing data from domain objects to relational database like MS SQL Server, in an automated, without Much programming. O/RM includes three main Parts:domain class objects, relational database objects and Mapping information on how Domain OB Jects map to relational database objects (tables, views & StoredProcedures). ORM allows us to keep the database design separate from our domain class design. This makes the application maintainable and extendable. It also automates standard CRUD operation (Create, Read, Update & Delete) so that the developer doesn ' t need to write it manually.
A Typical ORM tool generates classes for the database interaction for your application as shown below.
Visit Wikipedia for more information on object-relational Mapping
There is many ORM frameworks for. NET on the market such as Dataobjects.net, NHibernate, openaccess, subsonic etc. The Entity Framework is a open source ORM Framework from Microsoft.
Please note that the Entity Framework is a open source framework by Microsoft. You can contribute to the Entity Framework project on CodePlex.
Entity Framework Tutorial Basics (2): What is the Entity framework?