Changing Object Type in OODB

From: Bob Badour <bbadour_at_golden.net>
Date: Sun, 3 Jun 2001 12:59:41 -0400
Message-ID: <cauS6.816$JN3.200813700_at_radon.golden.net>


In another thread, a Java-only OODB proponent proposed the following as an obvious, straightforward design not requiring any thought:

>class Person
>class Employee extends Person
>class Manager extends Employee

I have the following question:

How does an existing object of type Employee change its type to Manager in the OODB or in Java?

Presumably, when I hire someone in a non-management position, I create an Employee object instance that is not a Manager object instance, and I give the new Employee object a specific identity.

If I later promote the person into a management position, I need to change the type of the Employee object instance into one that is also a Manager object instance, and I have to do so without changing the object instance's identity.

How is this done in Java? Received on Sun Jun 03 2001 - 18:59:41 CEST

Original text of this message