Win a copy of Svelte and Sapper in Action this week in the JavaScript 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Static methods and UML Sequence diag.

Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • 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.
+--------------+ +-------------+ +-----------------------+
|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
  • 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.
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
According to this UML glossary

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

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).]
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Static methods are represented by underlining the method name in a particular sequence diagram.
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic