Web services programming tips and tricks: Applying stereotypes and notes in UML sequence diagrams

Improving the quality and consistency of your diagrams

Application of UML stereotypes and notes to sequence diagrams increases the communication value of your models. This article was adapted from Chapter 6 of The Object Primer 2nd Edition.


Scott W. Ambler (scott_ambler@ca.ibm.com), Practice Leader, Agile Development, Rational Methods Group, IBM

Scott W. Ambler is President of Ronin International, a consulting firm specializing in object-oriented software process mentoring, architectural modeling, and Enterprise JavaBeans (EJB) development. He has authored or co-authored several books about object-oriented development, including the recently released The Object Primer 2nd Edition, which covers, in detail, the subjects summarized in this article. He can be reached at scott.ambler@ronin-intl.com and at his Web site at www.ambysoft.com.

25 January 2001

Also available in Japanese

In the Unified Modeling Language (UML), stereotypes are a mechanism to define common and consistent extensions to the UML notation. An individual stereotype denotes a common use of a modeling element and is demarcated using <<stereotype label>>. For example, in UML use case diagrams it is common to apply stereotypes such as <<include>> and <<extend>> to associations between use cases (see the tip Use Case Modeling Tips for details).

Stereotyping classifiers

Notice the use of stereotypes throughout the UML sequence diagram presented in Figure 1. For the classifiers, I applied the stereotypes <<actor>>, <<controller>>, and <<UI>> indicating they represent an actor, a controller class, or a user interface (UI) class, respectively. For now, a controller class is a placeholder for one or more classes that would be fleshed out during design to implement the business logic of your system. A common architectural strategy is to layer your system, separating your user interface logic, business logic, system logic, and persistence logic from each other.

Stereotyping messages

Stereotypes are also used for messages. Common practice on UML diagrams is to indicate the creation and destruction of messages with the stereotypes of <<create>> and <<destroy>>, respectively. For example, you can see that the ":SecurityLogon" object is created in this manner. (Actually, this message would likely be sent to the class that would then result in a return value of the created object, so I cheated a bit.) This object later destroys itself in a similar manner, presumably when the window is closed. In the Java programming language and C ++, methods that create objects are called constructors, and in C++, methods that destroy objects are called destructors. (Java code automatically manages memory, whereas C++ doesn't, so the Java language doesn't require destructor methods.)

UML notes

UML notes are basically free-form text that can be placed on any UML diagram, to provide a header for the diagram, indicating its title and identifier. (As you may have noticed, I give unique identifiers to everything.) Notes are depicted as a piece of paper with the top-right corner folded over. I also used a note to indicate future work that needs to be done, either during analysis or design. In this diagram, the "qualifications()" message likely represents a series of messages sent to the Student object. UML practice is to anchor a note to another model element with a dashed line when appropriate -- with the note attached to the message.



developerWorks: Sign in

Required fields are indicated with an asterisk (*).

Need an IBM ID?
Forgot your IBM ID?

Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.


All information submitted is secure.

Dig deeper into SOA and web services on developerWorks

Zone=SOA and web services
ArticleTitle=Web services programming tips and tricks: Applying stereotypes and notes in UML sequence diagrams