Introducing Object Relational Mapper
page 4 of 10
by Uday Denduluri
Average Rating: 
Views (Total / Last 10 Days): 40989/ 100

What is ORM?

Let us understand the ORM with a help of a figure given below.

As we can see from the figure above that there is a new layer that gets introduced called ORM. This layer acts as a bridge between DAL and database.  It generates SQL queries maps the Objects to the Tables.

ORM – Object Relational Mapper is a package that maps the objects to the relational tables and Tables columns to the object attribute one to one.

Example:  We have an Employee Table with some columns in it.  The figure below shows a business object of type Employee.  It is not mandatory to have the employee declaration as shown below.

The Code written below is in C#.  It typically explains a skeleton of business object.

Listing 1

Class Employee
  public ID;
  public Employee Name;
  public Employee Salary;

The Employee class created needs to have a metadata that helps the ORM map to the table. There are many ORM packages available that deal with encapsulating the metadata with the class.  We will look at the same in the next section.

Figure 2

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2021  |  Page Processed at 2021-12-04 9:10:34 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search