• 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

Synchronized and UML

 
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is in UML any possibility to show in diagram that some method is synchronized?
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Simply inserting the "synchronized" keyword is alright, I guess... But once I read in an online article that UML cannot depict the final, native, synchronised, transient and volatile modifiers that is available in Java...

That's why wherever I need to show the developers that synchronized methods must be used in their code, I simply use a small "synchronized" keyword beside the name of the method...
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use the Sterotype for synchronized in the Class diagram.
 
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I remember right, activity diagrams have specific symbols to show synchronization.

Not sure if the arrow in the Sequence diagram can be used to depict synchronization.
 
author
Posts: 608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On activity diagrams you can easily show parallel activities, an example of which is depicted at http://www.agilemodeling.com/artifacts/activityDiagram.htm#Figure2Swimlanes (it's the parallel black bars).

The sychronized stereotype can also be applied to methods as another poster indicates.

- Scott
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic