Leaving the Data in the Relational Database
Most commonly, data that's already stored in the database is allowed to remain in the relational database and it is accessed as it is needed. This allows relational data and object data to exist together in the same system without converting the relational data.
The class hierarchy you create for the existing data allows you to access the non-object data in an object manner. In this example, the views used to create the classes at the various levels would be used at run-time to imitate the object structure. For instance, the Employee View would imitate querying the object structure at the Employee Class level. See Employee View and Employee View equivalent from the class hierarchy.
The upside of this approach is that you can leave all your existing data in place and yet have an object schema of the data that can be used by object applications. This is one of the excellent uses of object-relational mapping products.
The downside of this approach is that you generally will not get higher performance from your data in the object application. You may if you can take advantage of caching the data in the client application, thereby minimizing access to the relational database. See caching.
It is the access to the relational database that is not faster. In fact it may be slower because of the additional layer of software to convert relational tuples to object instances. Also, accessing classes using underlying relational views that use joins could still be quite slow, depending how slow the joining operations are in the Relational DBMS. In the example of the Workstudy Class, it requires the use of joins. See WorkStudy View.
If the application cannot take advantage of caching the results of these joins, there is a potential performance problem. Finally, traversals of references between objects still will use index searches and, in some cases, intersection entities and joins, when the relational data accessed by the objects first comes from the Relational DBMS.
Next: Converting the data and storing it in an object database. Also see the related content below.
More on the general topic: Using the Data
- Converting the Data and Storing It in an Object Database
- Leaving the Data in a Relational Database and Using an Object Database