[OGo-Developer] hyper relationship howto?

YL developer@opengroupware.org
Sun, 20 May 2007 20:37:31 -0600


There are some practical reasons that one would hope some relationships
among many entities can be treated as one:

businessUnit <<--->>  address <<--->> person
may be ideally treated as

associationOwner (unit, person, ....) <-->> AddressAssociation <<--> Address

By a proper implementation of  AddressAssociation, address related problems
can be treated in a uniform way across many entities. And the reverse
problems(from address to objects have something to do with it) can be solved
equally easy.

Let's say AddressAssociation has the following attributes:

oid, oidAddress, oidOwner, ownerEntityName, startTime, endTime, oidType,
status, notes

That way, the relationship's context can be recorded in a proper way (in
reality, relationships are certainly not contextless).  Also, an obj can now
have many addresses as it actrually does, and the oidType can tell the kind
of relationship (owner? rent? ...).

There are many things can be better handled by hyper-relationships.

Such relationships are not typical in IT practice but very common in real
world.  Without EOF or similar frameworks, doing things like this can be too
costy, that's why WO:-). But...

In EOF, the callenge of such thing is mainly about to making

newAdressAssociation.setOwner(newOwner)
or   newAdressAssociation.addObjectToBothSidesOfRelationshipWithKey
(newOwner,"owner")
work.

In theory, EOF's key assignment logic is good enough for such generalized
case, It just not designed to look at the EOModel and realize hyper
relationships,  and  take care of attribute pair (oidOwner,ownerEntityName).
I can be wrong since I'm not doing much on most new version of WO

Thanks for any ideas