B
Bret Pehrson
I'm working on a (non-trivial) project which includes various & numerous
objects, some in my direct source control, some not.
I'm finding the need to somehow associate one object with another, somewhat
arbitrarily. The previous implementation (in C++) used external maps that
would create a 'link' between these objects. Needless to say, this was the
source of many problems due to the maintenance requirements of the links as
objects came and went.
My preference is now to create a definition that objects (specifically classes)
can derive from which would would allow for 'associations', something like:
class Associable
{
public void Associate(string key, object o);
public void Dissociate(string key);
public object Retrieve(string key);
// Other stuff omitted
};
Now, I can create an association between objects, at will, at runtime,
whenever.
Nothing too exciting, but I've been living in a cave for the last 3 years, so I
don't know if there has been any meaningful discussion of such a paradigm, and
the benefits/caveats of such. Anyone have any insights, references, etc.?
Thanks
objects, some in my direct source control, some not.
I'm finding the need to somehow associate one object with another, somewhat
arbitrarily. The previous implementation (in C++) used external maps that
would create a 'link' between these objects. Needless to say, this was the
source of many problems due to the maintenance requirements of the links as
objects came and went.
My preference is now to create a definition that objects (specifically classes)
can derive from which would would allow for 'associations', something like:
class Associable
{
public void Associate(string key, object o);
public void Dissociate(string key);
public object Retrieve(string key);
// Other stuff omitted
};
Now, I can create an association between objects, at will, at runtime,
whenever.
Nothing too exciting, but I've been living in a cave for the last 3 years, so I
don't know if there has been any meaningful discussion of such a paradigm, and
the benefits/caveats of such. Anyone have any insights, references, etc.?
Thanks