Wednesday, August 15, 2012

ORM


An ORM layer maps tables to classes, rows to objects, and columns to
attributes of those objects. Class methods are used to perform table-level
operations, and instance methods perform operations on the individual
rows.

ORM libraries map database tables to classes. If a database has a table
called orders, our program will have a class named Order. Rows in this table
correspond to objects of the class—a particular order is represented as an
object of class Order. Within that object, attributes are used to get and set
the individual columns.

In a typical ORM library, you supply configuration data to specify the map-
pings between entities in the database and entities in the program. Program-
mers using these ORM tools often find themselves creating and maintaining
a boatload of XML configuration files.


Source -- Agile Web Development With Rails

No comments:

Post a Comment