Book a Demo

Author Topic: Associate Class questions  (Read 6814 times)

jedwards

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Associate Class questions
« on: May 19, 2004, 07:15:58 am »
I've run into a case where I have attribues for a three-way association, that is there are attributes specific to a combination of a Vendor class, a Warehouse class and and Item class.  I'm not quite sure how to model this in a class diagram.

I've already got an associate class that holds attributes specific to a Warehouse and Item pairing.  Is it legal to take this WarehouseItem associate class and create an associate with the Vendor class?  Is there a better way to approach this?

Jon

thomaskilian

  • Guest
Re: Associate Class questions
« Reply #1 on: May 19, 2004, 08:45:07 am »
Hi Jon,
an association class can be constructed with the Assiociation Class relation (somewhere in the middle of the Structure toolbox). It creates the association class between the two classes you relate in that way.

jedwards

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Associate Class questions
« Reply #2 on: May 19, 2004, 09:13:24 am »
Thanks Thomas,

I had already created the Warehouse-Item association class following the steps you describe.  

Now, imagine that the Warehouse-Item association class on the left side of a new relationship and a Vendor class is on the right.  EA allowed me to connect the two with another association class.  This second association class holds Vendor-Warehouse-Item attributes.  The diagram looks a bit odd, but it describes what I need it to.

If EA allowed me to do it then it's legal UML, right?  :)

Jon
« Last Edit: May 19, 2004, 09:14:05 am by Jon_Edwards »

thomaskilian

  • Guest
Re: Associate Class questions
« Reply #3 on: May 19, 2004, 11:01:27 am »
Yes. This was already standard with the previous UML version.

angel-o-sphere

  • EA User
  • **
  • Posts: 112
  • Karma: +0/-0
    • View Profile
Re: Associate Class questions
« Reply #4 on: May 21, 2004, 04:19:49 am »
Hi jedward,

yes, its legal UML. You are in the analysis phase and use this feature.

During design however you have to break it up to use real classes as modern OO languages do not support link classes.

So if you have something like "Teacher" <---> "Student" where the link has two attributes "time" and "room", you need to invent the class Course with the attributes "time" and "room" and transform the diagram into "Teacher" <---> "Course" <---> "Student".

I usually do that imediatly and omit the link class and its attributes from start up.

Regards,
  angel'o'sphere
« Last Edit: May 21, 2004, 04:20:07 am by aos »