An object has a type, a unique identity and is part of a graph structure. It is in an environment where it is not straightforward to change an objects type (environment restrictions such as represented in memory or object database) . When changing the type all unique identity constraints must be observed, all metadata preserved and the graph structure preserved. This disclosure describes how the objects type can be safely changed without breaking uniqueness constraints and without losing any metadata or altering the graph structure.
Changing the type of any object within a graph of objects without loosing any metadata or graph structure
This disclosure has proposed an idea to allow you to safely change the type of any objects within a graph without loosing any metadata and still honour unique identity.
The object is to change the type of any object with a graph of objects without losing any metadata or graph structure. There are many situations where it is not possible to alter the type of an object directly, for example a programming language instance in memory or a situation where the type is very fundamental to the object (for example, in storing in a database). To further complicate matters often the object has a key in addition to the type and this key must be unique at all times.
So naively I might just delete the existing object to free up the key, then create the object again with the new type and the same key. The key will be available as I have deleted the previous object and of course creating it means I can create it using whatever type I wish. However by doing this I have destroyed the structure of the graph of objects and potentially lost any metadata which may have been on the original object.
I cannot change the type of the object directly ( as this is not possible in programming languages or object databases) and if I created a new object of the correct type I cannot reuse the key as it should be unique and of course is in use by the existing wrongly typed object.
So if I preserve the key I destroy the graph structure and lose metadata, but if I preserve the metadata I still destroy the graph and I will loose the unique key.
This solution allows the object type to be changed, the graph structure preserved and all metadata including the key to be preserved on the object.
The idea of this invention is to provide a function to replace the data type of an object wit...