• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Static methods and UML Sequence diag.

 
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are static methods represented in sequence diagram. For example, I call getInstance() on a singleton which returns a particular instance of Singleton. Then I want to apply getInfo() on this instance?
With the tool I use I can only put "Object" in my diagram. How should I represent it since I am adressing a class method and not a particular instance? Stereotype my object?
Any suggestion is welcome.
W.
+--------------+ +-------------+ +-----------------------+
|aClient:Client| | : Singleton | | aSingleton: Singleton |
+--------------+ +-------------+ +-----------------------+

[This message has been edited by Wilfried LAURENT (edited November 15, 2001).]
 
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not think UML states you can not call static methods in seq. diagrams. But if you are doing getInstance- you have an object. So your method need not be static. If it is a static method- you should not have to do a getInstance. getInstance or not you can call static methods in a Seq. diagram.
HTH
Sanjay
 
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1)
I beleive static methods do not belong to objects and are not included in any object but is taken from class' bytecodes. It is logical, since they are inter-objects and they are accessible even if there have not been started any object initiation of that class (there are even classes where you cannot do it, like System, and it was decided recently by javaranchers is also a Singleton)
2)
According to this UML glossary


sequence diagram
A sequence diagram is an interaction diagram that focuses on the time-ordering of messages.



message
A message is a conveyance of information from one object to one or more other objects with the expectation that activity will ensue, in the form of an action.



Since I believe that static methods is out of instances and time I do not see how they may be pacified with time ordering and messages.
It is my opinion but not the fact
[This message has been edited by G Vanin (edited November 15, 2001).]
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Static methods are represented by underlining the method name in a particular sequence diagram.
 
Forget Steve. Look at this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic