[OGo-Developer] hyper relationship howto?

Adam Tauno Williams developer@opengroupware.org
Mon, 21 May 2007 00:04:39 -0400


This message was cross posted to both webobjects-dev@lists.apple.com and
developer@opengroupware.org.  You shouldn't cross post.

> 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...

No, it is pretty easy;  most modern databases support complex types and
complex type comparisons.  So asking for everything with address
{street,city,state,zip} is pretty easy.  At least PostgreSQL, DB2, and
Informix do.  Assuming that is what you are talking about;  maybe I'm
missing some other portion of this thread but I don't quite get what you
are asking.

The term "hyper relationship" doesn't seem to be in common usage
anywhere;  Google finds 5 usages of the term, all appear to be by
you. :)

> 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