• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

UML notation, message to collection

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a decent understanding of the  sequence diagrams but Im struggling to figure out how to represent in sequence diagram scenario when one object adds to its collection another object that had created. The collection might be treeSet, hashMap and so on. When implemented both collection classes are objects however I cant find anywhere an example in UML how this is represented in UML. For example  would it be incorrect to show object sending message put(session) to an instance of  hashMap?




 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suppose you can distinguish the different collection messages are added (eg Set, Map etc) then what?

in pseudo code will it be like
if map then A
else if set then B
else C

Or are you wanting to say "create object X" at such and such


The first example (if then else) is more decision making hence activity diagram not sequence diagram

The latter then it's
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seems like you're falling into the trap of wanting to write executable UML. UML is for high-level ideas. The more low-level you go, the less useful UML diagrams become, in my opinion. Implementation details like parameter types and such are best expressed in code.  Read Jack Reeves' essays on how Code is Design.
reply
    Bookmark Topic Watch Topic
  • New Topic