Object-relational mapping
From DocForge
Object-relational mapping, or ORM, is a programming technique which corresponds data stored in a relational database with application objects. The ORM layer populates business objects on demand and persists them back into the relational database when updated.
Advantages [edit]
- ORM frees the programmer from dealing with simple repetitive database queries. Instead of writing SQL, the programmer requests objects from the ORM's persistence layer and calls a save procedure after updating an object.
- Conceptually, automatically mapping the database to business objects lets programmers focus more on business problems and less with data storage.
- The mapping process can aid in data verification and security before reaching the database. Proper data can be confirmed and appropriate messages can be returned to the user without relying on failed database queries.
Disadvantages [edit]
- ORM adds a least one small layer of application code, potentially increasing processing overhead. ORM can speed development time and lower complexity, but "manually" dealing with database interaction can be more efficient.
- ORM can load related business objects on demand. To keep it simple, this usually involves many small queries to load data as needed. This can sometimes be slower overall than using one complex query due to the overhead of query processing and server communications.

