Entity framework orm object relational mapper
Entity Framework is a Object Relational Mapper data API that enables programmers to query and update data stored in a database in a oops way. Oops way means, using entity framework, we can map database tables to .net classes. By mapping, we can set relationships between databases and the classes. By doing so, we can avoid writing SQL statements, as the framework will generate the appropriate sql execution logic.
ORMs are a solution to complex enterprise level ERP application programming. ORMS are designed as a solution to build an interface between the relational databases model and object oriented models to solve the problem of impedance mismatch.
What is impedance mismatch?
In the relational model, data is stored in a table and relationships are set among the tables and this data is in the normalized form to optimize the performance. To implement the business processes in the ERP application, application developers define the business processes in terms of classes, objects and inheritance hierarchy. This creates a mismatch.
Impedance mismatch refers to the inefficient transfer and usage of resources due to the difference in the way the database and the applications work. Programmers write code to bridge the gap between the OOPS model and relational model and this is additional work which can be avoided.
A good example of impedance mismatch is, data is handled in the object-oriented model as classes and objects, which are stored as rows and columns in a table in the relational database.
The ADO.NET Entity Framework addresses the above problem.
Roles of ORMS
ORMs maintain a unit of work pattern. A Unit of Work keeps track of everything that happens to a database during a business transaction. Using ORMs, we can maintain a list of business objects and also keep track of changes done to the object during updating, editing and adding. Examples of a Unit of Work are DataContext class in LINQ to SQL and the ObjectContext class in the Entity Framework. The DataSet can also be used as a Unit of Work.
ORMs provide an Identity map which keep track of all objects that have been read from the database in a single business transaction.
Lazy loading is a resource optimizing feature of ORM and is ref erred to the feature of loading a resource only when needed.
ORMs facilitates us to write object oriented queries which are translated to SQL statements which a database can understand. For example, if you are using an oracle database, ORMs convert object oriented queries to Oracle specific sql dialect. An ORM will cache data if it is not changed and make it available when required. This increases the performance of the application.
ORMs hide the underlying database and this allows us to scale the database application which is a common scenario when enterprise applications are installed and used in companies.
There are three ORMS used by enterprise ERP software developers. They are : LinqToSQL, EntityFramework and nHibernate(open source)
Entity Framework Articles
- entity framework entity data model
- querying entity data model using objectcontext
- using ado net entity data model in windows applications.html
- create entity data model using ado.net entity framework designer in visual studio
- create-sales-order-management-data-model-using-edmgen-tool.html
- display data in a gridview using ado.net entity data source control
- ways of querying entity data model
- query entity data model using linq to entities
- query entity data model with object services and entity sql
- query entity data model using linq methods
- parameterized objectquery against a entity data model
- query entity data model entity client
- linq to entities query with projections in c#
- entity framework - save changes to entities
- entity framework - insert new objects
- add an entity to associated entities
- deleting entities using deleteobject() method of objectcontext
- entity framework load method
- eager loading using include method in entity framework
- entity framework - retrieving a single entity
Most Viewed
Azure Q & A
Azure Platform
Grid-View
GridView CommandField example
Details-View
GridView and DetailsView Master/Detail page using SqlDataSource control
POCO
POCO overview and advantages - POCO class, Entity Framework in Enterprise Applications
Entity Framework
Query entity data model using linq to entities
Array List
Difference between arraylist and list collection
Web Services
How to create a Web service using Visual Studio.net
Form-View
FormView DataBound Event
Object Oriented Programming
Calling base class constructor in C#
Linq
Convert a sequence to a generic list using ToList()method
Project Ideas
Project ideas for students
AccountingSoftware
Accounting Software
MVC
Creating an ASP.Net MVC 3 application
.Net
Using assemblies in .net applications
ASP .Net
How to implement form validation using ASP.Net 2.0 Validation Controls
VB .Net
Constructors in Visual Basic.Net