File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Showing  conditions in sequence diagrams Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Showing  conditions in sequence diagrams" Watch "Showing  conditions in sequence diagrams" New topic

Showing conditions in sequence diagrams

Srinivas Pittala
Ranch Hand

Joined: May 22, 2011
Posts: 40


Is it a good idea to show conditions(if -then-else) in sequence diagrams?

I have a following scenario:

1) SuD checks external system for a value

If that value is insufficient then

validate some rules

if rules satisfies then

send a request to Some Other component

2) How to show external systems and web services in a sequence diagrams?

Searched this forum and found

external system can be shown as an Entity and adding some notes to it
web services can be shown as object with sterio type <<web service>>

Is this the right approach?

Certified guys, please provide your suggestions.


Unni Pillai
Ranch Hand

Joined: Aug 22, 2010
Posts: 35

Hi Kumar,

I used if-else condition in the sequence diagrams in a limited way. As long as the diagram is not getting complicated it is ok. If you have too many condition check. then think about splitting the diagrams.I have done that for authentication in my case.

Regarding your Q2, I completely omitted , 'what kind of component' information from my sequence diagrams, according to me, it is for explaining the message flow. In real life also we don't show component details in sequence diagrams.


Srinivas Pittala
Ranch Hand

Joined: May 22, 2011
Posts: 40

Unni ,Thank you very much for your response..

Q1: I will use

Q2: I read in this forum, all the classes and public methods in a class diagram should use in sequnce diagram .
In class diagram i represented external web services as subsytem with steriotype <<webservices>>
that means i can use the same as a lifeline ..

I agree. Here's the link:
subject: Showing conditions in sequence diagrams
It's not a secret anymore!