ORM

ORM Topics

What is ORM

Introduction to ORM

Object-relational mapping a general programming technique for converting data between incompatible system types [ different systems] using object-oriented programming languages.

Object-relational mapping ( ORM ) is a technique used to map any programming language objects to database objects directly.

ORM generates objects (similar to OOP) that virtually map the tables in a database

Example of few Popular ORMs:

 Hibernate  Java objects are mapped to Database objects
 PHP  HTML objects are mapped to MySQL database objects
 Doctrine  PHP objects are mapped to Database objects

 

 

 

 

 

ORM helps us to access and manipulate objects directly via programming languages without bothering too much about data sources.

 

How ORM works

What does ORM Framework do 

ORM is framework is written in an object oriented language (like PHP, Java, C# ) and it is designed to virtually work with relational databases.

It basically translates into: mapping objects to relational tables.

ORM is best example for encapsulation.

 

Encapsulation hides inner implementation and exposes data which is necessary for user.Similarly ORM techniques enables developers to change the code of applications developed without requiring changes to be done in database.

In order to access the database in Object Oriented context we can use ORM.

ORM manages the mapping details between a set of objects and underlying relational databases or data sources. Developers can work on the code they create & ORM takes cares of converting programming object to Db object.

Advantages of using ORM

Advantages of  using ORM for Development

  1. Speeds-up Development process by eliminating the need for repetitive SQL code at Multiple Places
  2. Minimizes the use of vendor specific or database specific SQL Quires
  3. ORM frameworks will protect our application from SQL injection attacks since the framework will be filtering the data before inserting data into DB
  4. Minimizes the time required to convert language object to DB object & vice versa
  5. ORM helps in Mapping data, it supports different mapping techniques like one-one,one-many,many-many & many-one

 

Leave a Reply

Your email address will not be published. Required fields are marked *