Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Operations in UML

 
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.
 
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.
 
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
 
He's giving us the slip! Quick! Grab this tiny ad!
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic