Mapping Tables to Objects
Using existing relational data with objects at the application level requires mapping tables to objects. This figure illustrates such a mapping. Mapping involves:
- Mapping relational data types into object types. In most cases this is straightforward mapping.
- Mapping relational table definitions to object classes. The table definitions map directly except for foreign keys. Those are replaced by relationships.
- Mapping inheritance based on a table or multiple tables. There may be type codes in a given table used to identify types of entities, such as types of clothing or types of employees. Those types can be turned into an inheritance structure at the object application level. Similarly, there may be separate tables for different types of entities. Again, this can be turned into an inheritance structure.
- Mapping tuple retrieval, keys and relational joins to relationships for object navigation. Object navigation replaces successive searches based on keys.
- Mapping "intersection tables" to object relationships. An example of an intersection table is the "Size Color" table used in the examples. This table exists because the relational model does not support many-to-many relationships. The relationship between "Size" and "Color Swatch" is a many-to-many relationship because a given size can have many color swatches and a color swatch can apply to many sizes.
See mapping objects to tables. Also see using existing relational schema to define objects.
Context for Mapping Tables to Objects
Related Articles for Mapping Tables to Objects
Author
Douglas K Barry
Principal
The Savvy Manager's Guide
Douglas K Barry is also the author of a book that explains Web Services, service-oriented architecture, and Cloud Computing in an easy-to-understand, non-technical manner.
Web Services, Service-Oriented Architectures, and Cloud Computing: The Savvy Manager's Guide (Second Edition)
by Douglas K Barry with David Dick
This is a guide for the savvy manager who wants to capitalize on the wave of change that is occurring with Web Services, service-oriented architecture, and—more recently—Cloud Computing. The changes wrought by these technologies will require both a basic grasp of the technologies and an effective way to deal with how these changes will affect the people who build and use the systems in our organizations. This book covers both issues. Managers at all levels of all organizations must be aware of both the changes that we are now seeing and ways to deal with issues created by those changes.