Reputation: 928
I have received the following UML diagram for implementation:
From the problem description I know that
Is this what the UML diagram expresses and if not, how can the described relationship be expressed in UML?
In other words: the relationship between Foo and Bar can only exist if both belong to the same Block. I have been told that the aggregation (diamond) in the diagram ensures that this is true.
I've asked another question about the same problem.
Upvotes: 0
Views: 70
Reputation: 11
see also http://msdl.cs.mcgill.ca/people/tfeng/docs/The%20Unified%20Modeling%20Language%20Reference%20Manual.pdf page 230, Figure 13-70
Upvotes: 0
Reputation: 11
http://www.omg.org/spec/UML/2.5/Beta1/PDF/ page 194 (in file 204), Figure 11.5
Upvotes: 1
Reputation: 19856
Your diagram is OK. In order to express the requirement that the Foos of a bar must be in the same Block of the Bar, you need what is called a constraint. In UML, constraints are usually formulated in the Object Constraint Language (OCL).
Your constraint may be written like this:
context Bar
inv: self.foo -> forAll(t | t.block = self.block)
Upvotes: 2