Object Relation mapping tool
O/R Mapping means Object/Relation Mapping. All of our application deals with objects as well as relational database.
A typical application consist of three layers namely
- Presentation Layer
- Business logic layer
- Data Access Layer
Now if we consider using of objects, we find that Objects are used in Presentation and business layer, but our Data access layer works with Relational database, which is very different from how we access our objects. Today any world application is been handled in OO fashion. Wasnât it something great if we access our Relational database in OO manner. Before we go further, its also needed as when we talk about our data access layer , we find that Data Access Layer is responsible for any code to save, delete, and retrieve your object from the database. You write methods in your DAL to retrieve different sets of objects, change status', and perform various other tasks. Writing this data access code *can be* very repetitive. To avoid this , now we use ORM tool rather than DAL. Yes, thatâs true. Now we didnât need to write those Insert, Update, Delete and Select statement , these all things is carried by our O/R Mapping tool. So now we have scenario something like this
It is a common scene that our objects does not have 100% exact mapping with the database columns. For e.g. , we might be interested in having the having one column in the table which resembles two column in the Objects or vice versa. There is also the name conflict which means that what it means as Fname in the object resembles FirstName in some table of some database. So what we need is a mapping between those objects and relational database. What GNOME is doing is that it is It generates the data access layer from the class model and schema mapping to the relational model provided by the developer. This introduces object-oriented concepts and true refactoring down to the data access logic tier
No comments:
Post a Comment