Book a Demo

Author Topic: Modelling OR relationships  (Read 5758 times)

Emilio

  • EA User
  • **
  • Posts: 78
  • Karma: +0/-0
    • View Profile
Modelling OR relationships
« 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?

Gary W.

  • EA User
  • **
  • Posts: 139
  • Karma: +0/-0
    • View Profile
Re: Modelling OR relationships
« Reply #1 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

fwoolz

  • EA User
  • **
  • Posts: 435
  • Karma: +0/-0
  • We have met the enemy, and he is us.<Pogo, 1970>
    • View Profile
Re: Modelling OR relationships
« Reply #2 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.
Fred Woolsey
Interfleet Technology Inc.

Always be ready to laugh at yourself; that way, you beat everyone else to the punch.


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13510
  • Karma: +573/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Modelling OR relationships
« Reply #3 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

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Modelling OR relationships
« Reply #4 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
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Modelling OR relationships
« Reply #5 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
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

fwoolz

  • EA User
  • **
  • Posts: 435
  • Karma: +0/-0
  • We have met the enemy, and he is us.<Pogo, 1970>
    • View Profile
Re: Modelling OR relationships
« Reply #6 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?
« Last Edit: May 30, 2010, 02:11:47 pm by fwoolz »
Fred Woolsey
Interfleet Technology Inc.

Always be ready to laugh at yourself; that way, you beat everyone else to the punch.