Structural Essence: Handling Bidirectional Associations

This is a page of the online appendix of our paper on Structural Essence.

Bidirectional Associations

There are three possible kinds of bidirectional associations, and we have thought of two options for transforming them into the distilled model.

Option
Case Association 1 split association (chosen) 2 avoid cycles
1 A 1<->1 B A->B
B->A
(essence=1)
AB
(essence=0)
2 A 1<->* B A->*->B
B->A
(essence=2)
A->*->B
B->*'
(essence=1)
3 A *<->* B A->*->B
B->*->A
(essence=3)
A->*->B
B->*'
(essence=2)

Options

  1. This option assumes that there is no difference between having one bi-directional association and having two uni-directional associations between two classes. The disadvantage of this option is that this assumption does not necessarily hold, and that each bi-directional associations introduces a cycle into the distilled model.

    A 1<->1 B should mean that a given A object points to one B object, and that B object points to THE SAME A object. Example: class Pacman { World w; } class World { Pacman p; }.

    A 1->1 B plus B 1->1 A should mean that a given A object points to one B object, a given B object is pointed to by one A object, a given B object points to one A object, and a given A object is pointed to by one B object. This is less restrictive, meaning that a given A object points to one B object, and that B object may point to any single A object; it does not have to point back to the SAME A object).

  2. This option assumes that a bidirectional association does not really imply a recursive type. In case 1, the whole structure is more like a split object. One probably could inline B into A. A given A and a given B always belong together. If one has an A, one also has a B, and that's it (nothing else is reachable from that A; no repetition here). In case 2, a B points back to the same A that points to it. A given B is pointed to by only one A.