Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Emilio on May 26, 2010, 07:01:33 am

Title: Modelling OR relationships
Post 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?
Title: Re: Modelling OR relationships
Post by: Gary W. on May 26, 2010, 07:31:01 am
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
Title: Re: Modelling OR relationships
Post by: fwoolz on May 26, 2010, 07:47:17 am
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.
Title: Re: Modelling OR relationships
Post by: Geert Bellekens on May 26, 2010, 03:46:55 pm
Fred,

I too always use XOR when putting a constraint between two associations.
I guess OR doesn't really constrain all that much :)

Geert
Title: Re: Modelling OR relationships
Post by: Paolo F Cantoni on May 26, 2010, 05:01:03 pm
Quote
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
Title: Re: Modelling OR relationships
Post by: sargasso on May 29, 2010, 08:54:43 pm
Just to be different, I have "always" used {mutex}, which is easier to search for.

 :-X
bruce
Title: Re: Modelling OR relationships
Post by: fwoolz on May 30, 2010, 02:10:06 pm
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?