Hi folks. I thought I would just throw this small problem your way. I am trying to come up with a solution but nothing is springing up at me so far.
What I want to do is have numerous freely associating `objects`, let's say they are just instances of a custom type. These objects need to be saved to disk and loaded back in later. They also need to be passed over a network to another computer which needs to use the objects in the exact same way as originally intended, interacting with specific other objects correctly despite the fact that another computer system might have its objects stored in an entirely random order. What with the saving/loading/networking it throws a spanner in the works.
All of the objects are free floating ie they are not necessarily in a list or a fixed order or organization. Any given objects can freely associate or disassociate with any others. They can be loaded or created any order.
If there is some kind of collection of objects on one computer system that is set up to work with certain other objects, how could these possibly be passed for example over a network to another computer and still know which objects to operate on? If the objects are saved to disk with some kind of ID number then when they are loaded back in maybe their ID number doesn't make sense anymore, and maybe the objects sent over a network all have different ID's on another computer.
I thought perhaps about some kind of remapping but even to remap you'd need to have a unique ID of some sort for each object to begin with?
So how can I identify which object is which? I am going to use groupings and categorization but I don't think that will be specific enough.
Any ideas greatly appreciated.
What I want to do is have numerous freely associating `objects`, let's say they are just instances of a custom type. These objects need to be saved to disk and loaded back in later. They also need to be passed over a network to another computer which needs to use the objects in the exact same way as originally intended, interacting with specific other objects correctly despite the fact that another computer system might have its objects stored in an entirely random order. What with the saving/loading/networking it throws a spanner in the works.
All of the objects are free floating ie they are not necessarily in a list or a fixed order or organization. Any given objects can freely associate or disassociate with any others. They can be loaded or created any order.
If there is some kind of collection of objects on one computer system that is set up to work with certain other objects, how could these possibly be passed for example over a network to another computer and still know which objects to operate on? If the objects are saved to disk with some kind of ID number then when they are loaded back in maybe their ID number doesn't make sense anymore, and maybe the objects sent over a network all have different ID's on another computer.
I thought perhaps about some kind of remapping but even to remap you'd need to have a unique ID of some sort for each object to begin with?
So how can I identify which object is which? I am going to use groupings and categorization but I don't think that will be specific enough.
Any ideas greatly appreciated.