File: relationships.txt

package info (click to toggle)
gaphor 0.13.0-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,692 kB
  • ctags: 2,971
  • sloc: python: 19,981; xml: 247; makefile: 54; sh: 40
file content (53 lines) | stat: -rw-r--r-- 2,126 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Relationships

A difficult point is relationships. We already have coded out one specific case:
comment lines, but those have a different behavior since they do not have
a model element of their own...

- In case of generalizations, realizations and dependencies, the direction of
the relationship is very important (not to mention state diagrams...)
- Assocuations have special model elements (AssociationEnd) at the end of
each line.


Generalization, Realization, Denepency, etc.

If one end of a relationship is not connected, nothing should happen...

We should try to manage all interaction from the model elements (classifiers,
etc.), since the canvas sends connect signals to those items (not the item
which handle is about to be connected).

This means that we should be able to determine:
- on which end of the relationship we are 
- what's on the other end of the relationship
- do a lookup to see if such relationship already exists
- create a new/assign an existing relationship to the connecting item
- remove the relationship on disconnect or deletion (reset on UNDO)


Association

Association is a pretty difficult case, since we are dealing with a collection
of objects at one (Assocation and a bunch of AssociationEnd objects).

At first we will only make bi-directional assocaitions (no n-ary assocaitions,
the ones with a 'diamond' inside).

If only one end is connected we do not need to do anything.

We should be able to determine:
- If an assocaition already exists between the given classes
- If an assocaition between classes is already drawn on the diagram (in which
  case we should look for another existing assocaition or create a new one)
- 

Note:

Some kinds of relations are repreesented by a line in a diagram, but have no
direct mapping to some model element (e.g. a comment line which connects a
comment to a model element). How do we determine if such a relation needs
to be removed or can stay? For comment lines we could check all representations
of the comment and see if one of the annotedElement's is in a diagram. If the
count is 2 or more, the relationship should remain intact.