Author Topic: Collaboration Element  (Read 4434 times)

Peter_Cheung

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
  • Nam-myoho-renge -kyo
    • View Profile
Collaboration Element
« on: November 16, 2002, 10:56:06 am »
Dear All:

Can anyone tell me what the collaboration element under the Use Case Group is for? I thought collaboration is a diagram type. When I create a collaboration diagram it appeared as Analysis Diagram type. I am a bit confused.

???

Thank you

Peter Cheung
« Last Edit: November 16, 2002, 11:29:22 am by Peter_Cheung »

mkroumer

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Collaboration Element
« Reply #1 on: November 17, 2002, 04:43:52 pm »
In UML, collaborations are used to represent analysis or design patterns, e.g. "responsibility chain".

fwoolz

  • EA User
  • **
  • Posts: 435
  • Karma: +0/-0
  • We have met the enemy, and he is us.<Pogo, 1970>
    • View Profile
Re: Collaboration Element
« Reply #2 on: November 17, 2002, 04:58:37 pm »
From "Real Time UML," 2nd edition, pg. 81:

"[A] collaboration represents a set of objects that assume specific roles in order to achieve the use case."  A collaboration is thus the realization of a use case.  This provides a means of linking classes/objects to the use cases they implement.

Hope this helps,
Fred Woolsey
Fred Woolsey
Interfleet Technology Inc.

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


PhilR

  • EA User
  • **
  • Posts: 87
  • Karma: +0/-0
    • View Profile
Re: Collaboration Element
« Reply #3 on: November 17, 2002, 07:23:40 pm »
This will be a bit hard to explain without a whiteboard but I'll have a go :)

Suppose I want to conceptually model a network of flights between airports.  No problem I use a class called "Airport" and a "recursive" association called flight.  A recursive association is one that connects two instances of the same class.  In other words both ends of the associaiton touch the same class.  Both ends of the association have 0..* multiplicity.

Most conceptual modellers will instantly recognise that this model fragement represents a network.  Now the fun starts.  Where do I put the atribute for distance between airports?  The problem is that I can't capture this attribute in the basic model.

OK. I introduce a second class called "Flight" and have two associations between "Airrport" and "Flight".  One association is called "Depart" and the other is called "Arrive".  The "Airport" end of both associations has a multiplicity of 1 and the "Flight" ends a multiplicity of 0..* (closed or airports under construction do not have flights).

Many conceptual modellers will still recognise this as a network.  Now where do I put the operation to display arrivals and departures.  "Airport"?  Possible.  I would need displayArrivals() and displayDepartures().  But what about "transit" airports?  I don't want to display these on my arrivals or depatures boards.  OK I could add another association between "Airport" and "Flight" called "Transit".  Getting messy.  What about alternate airports for flights that are diverted etc etc.

A better apporach is to create an "abstract" class "AirportRole" with an operations display(). This class has an association with "Airport" and "Flight".  It also has three specialised (sub-)classes "Depart", "Arrive" and "Transit".  These specialised classes all inherit the display() operation but implement it differently.

If I tell "Depart" to display() it displays departures, if I ask "Arrive" to display() it displays arrivals, if I ask "Transit" to display it does nothing or returns an error.  This is "polymorphism".

However, very few conceptual modellers would now instantly recognise this as a network.  Enter the collaboration element.  If I create a collaboration element, label it "Network" and connect it to "Airport", "AirportRole" and "Flight" it becomes perfectly obvious that we are dealing with a network.

Phil.

Peter_Cheung

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
  • Nam-myoho-renge -kyo
    • View Profile
Re: Collaboration Element
« Reply #4 on: November 24, 2002, 06:11:47 pm »
Hi Phil,

Well explained even without the whiteboard.  Than you!

Cheers!
Peter