Object Relational Mapping: The best of both worlds

I’ve been meaning to post this for a long time, ever since I used Propel as part of a Symfony project. Object Relational Mapping or ORM is one tool that I feel most developers do not utilize to the fullest. So here’s a simple primer:

Relational Models make it very easy to address large amounts of data at a stretch. For example, a simple SELECT statement like SELECT name, email FROM user WHERE location LIKE 'Trivandrum' results in the population of an entire set of values. An OO model OTOH makes it very simple to manipulate discrete entities of data: $user = New User; $user->name = "Vishnu"; offers intuitive getters/setters.

ORM offers the best of both worlds. In Propel, there are two classes for a single table. Peer classes refer to the entire table and perform operations on sets whereas instances of table classes act as getters and setters. Without using SQL and only OO, this simple abstraction offers a lot of flexibilty to any database programmer. Look at the propel documentation for more.

2 Replies to “Object Relational Mapping: The best of both worlds”

  1. Pingback: Buy phentermine.
  2. Pingback: Cialis.

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s