• Post Reply Bookmark Topic Watch Topic
  • New Topic

UML notation, message to collection  RSS feed

 
John Watts
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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?




 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • 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
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!