Book a Demo

Author Topic: N-ary association  (Read 8901 times)

Ilja Kraval

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
N-ary association
« on: January 20, 2003, 11:53:06 pm »
Hi all,

I have problem, please advice me:

How can I make class of N-ary associaton in EA? This class is connected to diamond with dashed line (see example: UML 1.4 from OMG, chapter 3.47.4.). N-ary asoc. class is "more general assoc. class" for more then 2 classes on ends. In Help I see connecting without this dashed line, this dashed line shows "who is N-ary assoc class", I dont know, how to do it in diagram.

Thanks, Ilja Kraval.
RNDr. Ilja Kraval,
Object Consulting,
Czech Republic

dknox

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: N-ary association
« Reply #1 on: February 01, 2003, 03:40:12 pm »
Hi Ilja,
In build 3.51_600, the Class category in the Toolbox has the N-ary association icon.

HTH,
-- dave

fwoolz

  • EA User
  • **
  • Posts: 435
  • Karma: +0/-0
  • We have met the enemy, and he is us.<Pogo, 1970>
    • View Profile
Re: N-ary association
« Reply #2 on: February 02, 2003, 07:41:12 am »
Regarding N-ary associations, is there a "standard" way within UML/EA to represent a conditional association (i.e., "ONE OF" or "CHOICE") where a subset of a class/structure can have one of several values, depending on the value/values of other elements in the object?  I've tentatively represented this with an N-ary association and association "names" that express the related conditional statement.

Cheers,
Fred Woolsey
Fred Woolsey
Interfleet Technology Inc.

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


Ilja Kraval

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: N-ary association
« Reply #3 on: February 02, 2003, 12:22:34 pm »
Hi fwoolz,

I am not sure if your approach is correct. N-ary association is used for situation of entities, which are made as combination of association to other entities, like this:

Examination (at school)  with attributes Date and Time is made as combination with three “associations ends” to one Room, to one Teacher and one Subject from lists of them. We can obtain all information needed from List of Examinations, e.g. in which Rooms one selected Teacher examines, or where the selected Subject is examined and so on.  In ERD it is mapped to “association table” with attributes Date, Time and three foreign keys (IDRoom, IDTeacher, IDSubject).  

If I understand your question well, in UML maybe it would be better to use qualifiers or constraints in your situation.

Ilja Kraval
RNDr. Ilja Kraval,
Object Consulting,
Czech Republic

fwoolz

  • EA User
  • **
  • Posts: 435
  • Karma: +0/-0
  • We have met the enemy, and he is us.<Pogo, 1970>
    • View Profile
Re: N-ary association
« Reply #4 on: February 02, 2003, 03:06:17 pm »
I believe you're right... after some thought, I think it is better to have the two (in this case) possibilites shown as subclasses of a base class that has all elements except for the "ONE OF" portion, or perhaps have the subclasses override a "dummy" attribute in the base class representing the "ONE OF" element.  The only additional point I'll make is that my question was the result of trying to represent in UML an ASN.1 definition of a data structure using "ONE OF."

Thanks,
Fred Woolsey
Fred Woolsey
Interfleet Technology Inc.

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


Javier

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
  • Necessity is the mother of email
    • View Profile
Re: N-ary association
« Reply #5 on: July 30, 2003, 03:26:57 pm »
fwoolz,

What you are describing is supported by UML.  The way to describe it is by using a constraint between the two associations.  Unfortunately, EA does not support it, although Rational Rose does.  You can describe it as follows:

------------------------------------
        |
        | {subset}
       \|/
        v
------------------------------------

You can find this and more in the book The Object Constraint Language. OCL is now formally part of UML 2.0!

I'm sorry for the poor-man's UML diagram ;-)

Regards,

Javier
We must become the change we want to see.
- Ghandi

mbc

  • EA User
  • **
  • Posts: 237
  • Karma: +1/-0
  • Embedded software developer
    • View Profile
Re: N-ary association
« Reply #6 on: August 01, 2003, 06:12:01 am »
Javier,

EA does support constraints on associations. Right-click on the association and select "Attach note or constraint".

Mikkel

Javier

  • EA User
  • **
  • Posts: 67
  • Karma: +0/-0
  • Necessity is the mother of email
    • View Profile
Re: N-ary association
« Reply #7 on: August 01, 2003, 11:44:59 am »
Mikkel,

Agreed, but the constraint is depicted as a note wrapped around curly braces: {constraint}, instead of the association between associations notation that I drew in my posting.

Although internally it may be stored as a constraint, the icon--which is what conveys the right information to me--is incorrect.

In the {subset} constraint, the direction of the arrow counts:  A is a subset of B.  With the EA notation it's not clear.

Thx.


We must become the change we want to see.
- Ghandi