CSC/ECE 517 Fall 2009/wiki3 12 Patterns for ORM: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
=='''Overview'''==
=='''Overview'''==
[http://en.wikipedia.org/wiki/Object-relational_mapping Object-relational mapping] is not trivial. Apart from being based on Software Engineering principles like coupling, cohesion and polymorphism, the object paradigm focuses on building applications out of objects that have both data and behavior. However, the relational paradigm is based on mathematical principles and focuses primarily on storing data. If only data objects were to be mapped to the relational database the procedure would have been fairly straightforward. With the growing complexities of object models, concepts like aggregation, inheritance, polymorphism, association between classes, and data type (smarted than SQL data types) have to be mapped to relational table structure. The table below highlights the fundamental mismatch between object oriented data model and relational data storage.
[http://en.wikipedia.org/wiki/Object-relational_mapping Object-relational mapping] is not trivial. Apart from being based on Software Engineering principles like coupling, cohesion and polymorphism, the object paradigm focuses on building applications out of objects that have both data and behavior. However, the relational paradigm is based on mathematical principles and focuses primarily on storing data. If only data objects were to be mapped to the relational database the procedure would have been fairly straightforward. With the growing complexities of object models, concepts like aggregation, inheritance, polymorphism, association between classes, and data type (smarted than SQL data types) have to be mapped to relational table structure. The table below highlights the fundamental mismatch between object oriented data model and relational data storage.
=='''Inheritance Mapping'''==
==='''Single Table Inheritance'''===
==='''Class Table Inheritance '''===
==='''Concrete Table Inheritance'''===
=='''Association Mapping'''==
==='''One-to-one mapping'''===
==='''One-to-many mapping'''===
==='''Many-to-many mapping'''===
=='''Aggregation Mapping'''==
==='''Single table aggregation'''===
==='''Foreign key aggregation'''===
=='''Conclusion'''==
=='''References'''==

Revision as of 17:45, 17 November 2009

Overview

Object-relational mapping is not trivial. Apart from being based on Software Engineering principles like coupling, cohesion and polymorphism, the object paradigm focuses on building applications out of objects that have both data and behavior. However, the relational paradigm is based on mathematical principles and focuses primarily on storing data. If only data objects were to be mapped to the relational database the procedure would have been fairly straightforward. With the growing complexities of object models, concepts like aggregation, inheritance, polymorphism, association between classes, and data type (smarted than SQL data types) have to be mapped to relational table structure. The table below highlights the fundamental mismatch between object oriented data model and relational data storage.

Inheritance Mapping

Single Table Inheritance

Class Table Inheritance

Concrete Table Inheritance

Association Mapping

One-to-one mapping

One-to-many mapping

Many-to-many mapping

Aggregation Mapping

Single table aggregation

Foreign key aggregation

Conclusion

References