This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Operations in UML

 
James Turner
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I am fairly new to UML and I have been wondering how best to represent operations that return collections, for example, an aircraft has multiple seats, therefore there could be a method called getSeats() which would return a collection of Seat objects.

My UML editor allows me to set a return type for a method that is a single object, but I am not sure how to represent a collection of objects.

Does anyone know how to do this?

Thanx for any help.

James.
 
Abhijit Jawale
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can consider collection as a single object. UML representation will allow you to return ojbect like set/list/array or map.
 
James Turner
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Abhijit Jawale:
You can consider collection as a single object. UML representation will allow you to return ojbect like set/list/array or map.


Would it be correct to specify the return value as a list of Seats, for example: list<Seat> ?

Or something similar.

I would prefer the client/user/developer looking at the diagram to know what is in the list, but I also want to remain within the realm of correct UML.

Thanx for any help.
James.
 
Erik Brakkee
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi James,


In many cases, collection return values can be modeled as arrays. Then, you explain in your assignment that you use the convention to model collections as arrays. During development, the actual implementation can then be chosen (array, list, set).

Cheers
Erik
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic