ORM
object/relational mapping. The slash stresses the mismatch problem that occurs when the two worlds(object and relational db) collide. In a nutshell, object/relational mapping is the automated(and transparent) persistence of objects in a java application to the tables in a relational database, using metadata(data about data) that describes the mapping between the objects and the database.
ORM, by essence, works by(reversibly) transforming data from one representation to another. This implies certain performance penalties. However, if ORM is implemented as middleware, there are many opportunities for optimization that wouldn't exist for a hand-coded persistence layer.
An ORM solution consists of the following four pieces,
1. An API for performing basic CRUD operations on objects of persistent classes
2. A language or API for specifying queries that refer to classes and properties of classes (HQL for Hibernate or JPQL for JPA)
3. A facility for specifying mapping metadata(xml or annotation)
4. A technique for the ORM implementation to interact with transactional objects to perform dirty checking, lazy association fetching, and other optimization functions.
Why ORM?
1. Productivity
2. Maintainablity
3. Performance
4. Vendor Independence
Comments
Post a Comment