• 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

Static class connection

 
Ranch Hand
Posts: 180
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

What is the connection type between two classes when
one class is accessing another class's static method.
I understand the aggregation and Composition but
how to depict the static method call.
Please help.

Thanks in Advance.
Saurav
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The only difference is that you are calling a method on the class itself rather than on an object instance.

As UML 2 Sequence Diagrams outlines you use ClassName instead of rolename:ClassName in a sequence diagram role box

Have you had a look at static aggregation yet?
 
saurav sarkar
Ranch Hand
Posts: 180
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Peer for the reply.

What i have done in my class diagram is i have made the methods underlined
to depict their static behaviour and i have kept the aggregation relationship but made the scope of the target role as a classifier
I am using Enterprise architect.
But is there way to depic the relationship between the two classes
differently than the simple aggregation.
Or the Concept of aggregation in UML well applies when a class
accesses another class's static method.
Please do reply.

Thanks in advance.
Saurav
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd give it a generic association and call it a day. Composition doesn't seem right.
 
saurav sarkar
Ranch Hand
Posts: 180
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with you Stan ........composition does not fit completely
But i think aggreation or association doest fit either ideally.
Because i am just getting the methods of a class.
I am not instantiating a class here.
 
Ranch Hand
Posts: 376
Scala Monad
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If is just a dependency association, I wouldn't show it in the class diagram.
Dependencies aren't useful at that level, they just add noise.
The component diagram is better for that.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do Not Model Every Single Dependency

Originally posted by Gabriel Claramunt:
they just add noise.



I have yet to encounter a UML tool that lets you depict models simply. For that you have to use a white board + digital camera (+ White Board Photo), and/or possibly a drawing program if you require "neat" pictures.
 
reply
    Bookmark Topic Watch Topic
  • New Topic