Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: Emilio on May 26, 2010, 07:01:33 am
-
In UML you can model an OR relationship between relationships. In other words two relationships connected to the same object but only ONE is valid at any given time.
In UML this is apparently modelled by joining both associations with a dashed line accompanied by "OR".
Is there a way to do that in EA?
-
In the Class Diagram (that has both relations shown), right-click on one and select 'Attach Note or Constraint...'. From the "Link Relations" window shown, click-select the other relation.
Select 'Constraint' (on the top right). Double-click the resultant "Notes" window and type in "OR". It'll show up as an {OR} note with links to both associations. Move the note to a convenient place between the two relations.
HTH
Gary
-
Not to be too picky, but isn't the correct designation "XOR", as in "exclusive OR"? Logical OR (inclusive OR) is either one or the other OR BOTH, while XOR is either one or the other BUT NOT BOTH.
-
Fred,
I too always use XOR when putting a constraint between two associations.
I guess OR doesn't really constrain all that much :)
Geert
-
Fred,
I too always use XOR when putting a constraint between two associations.
I guess OR doesn't really constrain all that much :)
Geert
OR is implicit anyway... Handled by multiplicity.
Paolo
-
Just to be different, I have "always" used {mutex}, which is easier to search for.
:-X
bruce
-
To be honest, I don't much care for the use of a constraint "element", however you designate the constraint, to indicate mutual exclusivity. XML Schema has the <xs:choice> model group compositor; why can't the UML grandees come up with something along these lines instead of the multiply linked constraint kludge?