Since December, 2005, I produced an earlier version of this page.
That early verison has been (since 24 December 2007) updated to this page.

[Smartdraw.com Logo]

SmartDraw offers clear, brief explanations and examples of the UML diagrams as part of a tutorial. They also offer a 30-day free trial during which you may make UML diagrams using SmartDraw. Specific explanation and diagrams will be found at:

  1. Class Diagrams
  2. Package Diagrams
  3. Object Diagrams
  4. Use Case Diagrams
  5. Collaboration Diagrams
  6. Statechart Diagrams
  7. Activity Diagrams
  8. Component Diagrams
  9. Deployment Diagrams

Book: UML For JAVA Programmers

View this powerpoint slideshow based on the book.

UML For JAVA Programmers is precisely the book that I have been looking for to guide the level and types of UML diagrams that our students in the International Baccalaureate program might fruitfully learn and apply without becoming overwhelmed with what has become 800 pages of the diagramming documentation standard for all OOP languages.

Robert Martin, the author, argues that it is just as important to decide when not to use UML as when to apply it. Furthermore, he presents only those diagrams that are used most of the time when implementing Java code. Indeed, he completely avoids conceptual level UML and focuses exclusively on the specification and implementation levels and their corresponding UML diagrams, which is good because that is precisely where our students must perform.

Indeed, in Chapter 1 of UML For JAVA Programmers Martin argues that five types of UML diagrams "are enough for most purposes. Most programmers could live without any more knowledge of UML than what is shown here." [page 8] What are those five diagrams?

  1. Class Diagram: shows the major classes and relationships in the program.
  2. Object Diagram: shows a set of objects and relationships at a particular moment in the execution of the system. You can view it as a snapshot of memory.
  3. Sequence Diagram: describes how a particular method is implemented, clarifying the order of the messages.
  4. Collaboration Diagram: contain the same information that sequence diagrams contain, but clarify relationships between the objects.
  5. State Diagram: provides notation for finite state machines, useful for figuring out how a system behaves.
TaskTopicAssignments

1

Learn About UML

Borland's UML Tutorial [csg] [web] is a great introduction to UML.

An interesting intro is: Introduction to the Unified Modeling Language [pdf]

Donald Bell wrote a great intro in 2003: UML basics: An introduction to the Unified Modeling Language [csg] [web]

Scott Amber's UML 2 Activity Diagramming Guidelines is a clear and well organized overview of UML 2. (The "2" refers to version "2" of UML.) Note especially descriptions of the different UML diagrams. Of the 13 different diagrams described by Amber, he lists three of them as having high learning priority:

  1. Activity Diagram - See Amber's UML Activity diagram guidelines.

  2. Class Diagram - See Amber's UML Class diagram guidelines.

  3. Sequence Diagram - See Amber's UML Sequence diagram guidelines.

TaskTopicAssignments

2

Install EclipseUML

EclipseUML is an Eclipse plug-in developed by Omondo. There is a free edition and a studio edition of EclipseUML. The free edition will cover the modeling needs for this course.

Caveat:   Omondo crippled EclipseUML Free Edition. Diagrams created at home using Omondo's EclipseUML Free Edition cannot be restored with another installation of EclipseUML Free Edition, including the school's installation, and vice versa.

Students using only EclipseUML Free Edition should be prepared to do all of their UML diagrams exclusively on either their home or school computer.

EclipseUML 2007 Europa Studio Edition, costing $3,490US for 10 academic licenses (25 December 2007), can restore EclipseUML Free Edition diagrams.

Academic "EclipseUML Studio Edition Floating" licenses were free until this academic year, which was appreciated while it lasted.

Install Eclipse &
EclipseUML Free Edition

  1. These directions assume that the latest version of Java's SDK has been installed and added to the system's environmental path variables.

    Successful installation is best assured by the bundle implentation explained below, but you may care to view alternative implementations by watching How To Install EclipseUML.

  2. Install Omondo's bundle of Eclipse and the Eclipse plug-ins: EclipseUML Free Edition, EMF (Eclipse Modeling Framework), GEF (Graphical Editor Framework) and UML2.

  3. Extract the zipped file to the root of c:\ which results in everything sitting in c:\eclipse.

  4. Create a shortcut of the c:\eclipse\eclipse.exe file and copy the shortcut to the start menu.

  5. Eclipse records all of its plugins after Help → About Eclipse Platform → Plug-in Details.

  6. Learn to use Omondo's UML configuration after Help → Help Contents → EclipseUML User Guide.

TaskTopicAssignments

3

Activity Diagram

UML activity diagrams are the object-oriented equivalent of flow charts and data-flow from structured development. They describe activities and flows of data or decisions between activities. Activity diagrams and state diagrams are related. While a state diagram focuses on an object undergoing a process, an activity diagram focuses on the flow of activities involved in a single process.

Activity diagrams provide a very broad view of business processes. It can be used to break down the activities that occur within a use case. An Activity Diagram could be used for describing work flows across many use cases, analysing a use case or dealing with multi-threaded applications. Activity diagrams can be used to explore the logic of:

  1. a complex operation
  2. a single use case
  3. several use cases
  4. a business process
  5. complex business rules
  6. software processes

Source: Concept of Activity Diagram in EclipseUML User Guide


  1. Great overview of the UML Activity Diagram is Donald Bell's UML Basics (Part II) - The activity diagram

  2. Louisiana State University's 1998 course ISDS 7525 is informative: Activity Diagrams

TaskTopicAssignments

4

*.uud

User Stories
Use Cases
Use Case Diagram

Use Case Diagram Illustrated

Do the User Stories first, then draw the Use Case Diagram. Each "bubble" in the Use Case Diagram should correspond to a User Story.

The Use Case Diagram describes the behavior of a system from a user's standpoint : functional description and its major processes.

It provides a graphic description of who will use a system and what kind of interactions to expect within that system. Use Case Diagrams are useful when describing requirements for a system in the analysis, design, implementation and documentation stages.

A Use Case Diagram is a collection of actors, Use Cases, and their communications.

Source: Concept of Use Case Diagram in EclipseUML User Guide

!IMP! Listen to a great talk and slide show by by Jim Heumann, Requirements Evangelist, IBM Rational Writing Good Use Cases (76:34)

From the book, Use-Case Modeling, two chapters have been published on the Internet at IBM's Rational. They are worth perusing.

Print the handout, Negotiating the Exercise html pdf wpd

The making of this handout was prompted when, on 7 December 2005, there was significant confusion over the precise sequence of tasks and key pushes in order to negotiate the following exercise. This handout provided the needed clarification.

  1. Read the NCSU Use Case Diagram Tutorial. csg web

  2. Load and print (as in hard copy) and study the CoffeeMaker User Stories and sample Use Case Diagram in anticipation of the next assignment. That is, this is the "answer" to the next assignment below. Use is as a model to how you may write user stories and a sample use case diagram.

    The "user stories" are less accurately but more famously known as "case uses".

  3. Import the CoffeeMaker project into your workspace. Create a use case diagram that models the requirements of the system. (Hint: This has already been done for you in the already downloaded CoffeeMaker User Stories and sample Use Case Diagram.)

  4. From within Eclipse, go to Help --> Help Contents --> Eclipse UML User Guide --> Diagrams --> Use Case Diagram. This was automatically installed when you installed EclipseUML. Carefully read the EclipseUML tutorial Use Case Diagram.

    • Concept
    • Toolbar
    • UseCase Diagram Example

  5. Using the already downloaded CoffeeMaker User Stories and sample Use Case Diagram, create (redo) the same Use Case Diagram. It will give you valuable practice in creating a UseCase Diagram using EsclipseUML.

TaskTopicAssignments

5

*.ucd

Class Diagram
By Reverse Engineering
Code to Diagram

Class Diagrams are static and show an overview of a system. A system is composed of classes and the relationships among them.

The Class Diagram model describes the static structure of the symbols in the system. This model allows you to graphically represent symbol diagrams containing classes. Classes are arranged in hierarchies sharing common structure and behavior and are associated with other classes.

UML class diagrams show the classes of the system, their inter-relationships, and the operations and attributes of the classes.

Source: Concept of Class Diagram in EclipseUML User Guide


Class Diagram Illustrated
Class Diagram Associations Only - Deitel 140
Class Diagram Including Attributes & Operations - Deitel 517

Here you will cause Omondo's EclipseUML to make a UML class diagram from the existing source code of a program called CoffeeMaker.

Formative evaluation is best practice rather than summary evaluation.

Formative evaluation is the evaluation of a design while "forming" (coding) the design. When improvements or errors are identified, both the design and code should be modified as soon as reasonably possible to enhance the program. Formative evaluation is best practice.

Summative evaluation is the evaluation of a design after the coding is completed. Changes in design are not permitted before completion. Summative evaluation is worst practice. Much preferred, more successful and less costly is the continual correction through formative evaluation.

First, design your program using a class diagram as best you can. Then, after the initial draft of the class diagram is designed, write source code that implements the class diagram. You often think of other classes or identify errors or improvements in design while coding.

It is appropriate while coding to modify both the design and source code of a program, including modifying planning instruments such as a UML class diagram.

  1. Learn how to create a simple UML class diagram from this flash movie (2.81MB) [csg] [web] by Eric Long, a technology consultant with the IBM Developer Skills Program. Ignore the inital (2005) obsolete instructions for installing EclipseUML; but do note how creating a class diagram results in generation of actual Java code.

  2. Great overview of the UML Class Diagram is Donald Bell's UML Basics (Part III) - The class diagram

  3. Read the NCSU Class Diagram Tutorial.csg web

  4. Import the CoffeeMaker project into your workspace. Reverse engineer the class diagram of the project. Be sure to first right click the package icon.

  5. From within Eclipse, go to Help --> Help Contents --> Eclipse UML User Guide --> Getting Started. This was automatically installed when you installed EclipseUML. Carefully read the EclipseUML tutorial Creating a First Diagram.

    • Class Diagram Creation
    • Classes and Interfaces
    • Attributes
    • Methods
    • Implementation and Inheritance

    Note that you must generate the associations yourself.

  6. Practise using EclipseUML with class diagrams. Similar key-push techniques are used to create other UML diagrams in EclipseUML.

TaskTopicAssignments

6

*.usd

Sequence Diagram

A sequence diagram is a model describing how groups interact over time. It is an interaction diagram that details how operations are carried out: what messages are sent and when.

You use the sequence diagram model to describe the aspects of your system that change over time. These are events that mark changes, sequences of events and so forth. The time sequence interaction is shown in the sequence diagram and consists of two dimensions. The vertical dimension (time) and the horizontal dimension (different objects).

UML sequence diagrams can be used to:

  1. explore your design
  2. feel which classes are going to be complex
  3. validate the logic and completeness of a usage scenario
  4. detect bottlenecks within an object-oriented design

    Source: Concept of Sequence Diagram in EclipseUML User Guide


Sequence Diagram Illustrated
  1. Read the NCSU Sequence Diagram Tutorial.csg web

  2. From within Eclipse, go to Help --> Help Contents --> EclipseUML User Guide --> Diagrams --> Sequence Diagram. This was automatically installed when you installed EclipseUML. Carefully read the EclipseUML tutorial Sequence Diagram.

    • Concept
    • Drag'n'Drop
    • Toolbar
    • Reverse Engineering
    • Extension
    • Filtering
    • Sequence Diagram Example

TaskTopicAssignments

7

*.uld

Collaboration Diagram

A Collaboration diagram is the cross between a symbol and a sequence diagram. It describes a specific scenario. Numbered arrows show the movement of messages during the course of a scenario.

Collaboration diagrams show the same information as sequence diagrams, but focus on object roles instead of the times that messages are sent.

UML collaboration diagrams, like UML sequence diagrams, are used to explore the dynamic nature of your software.

Collaborations diagrams are often used to:

  1. provide an overview of a collection of collaborating objects
  2. allocate functionality to classes
  3. model the logic of implementation
  4. examine the roles that objects take within a system

In a sequence diagram, object roles are the verticals and messages the connecting links. In a collaboration diagram, the object-role rectangles are labeled with either a class or object name.

Source: Concept of Collaboration Diagram in EclipseUML User Guide


Collaboration Diagram Illustrated
  1. From within Eclipse, go to Help --> Help Contents --> EclipseUML User Guide --> Diagrams --> Collaboration Diagram. This was automatically installed when you installed EclipseUML. Carefully read the EclipseUML tutorial Collaboration Diagram.

    • Concept
    • Drag'n'Drop
    • Toolbar
    • Collaboration Diagram Example

TaskTopicAssignments

8

*.upd

Robustness Diagram

A Robustness Diagram is basically a simplified UML communication/collaboration diagram which uses graphical symbols.

Source: Concept of Robustness Diagram in EclipseUML User Guide


Robustness Diagram Illustrated
  1. From within Eclipse, go to Help --> Help Contents --> EclipseUML User Guide --> Diagrams --> Robustness Diagram. This was automatically installed when you installed EclipseUML. Carefully read the EclipseUML tutorial Robustness Diagram.

    • Concept
    • Robustness Diagram Example

TaskTopicAssignments

9

*.utd

State Diagram

A state diagram shows the sequences of states that an object or an interaction goes through during its life in response to received stimuli, together with its responses and actions. The state of an object depends on its current activity or condition. A state diagram shows the possible states of the object and the transition that cause a change in state.

State chart diagrams are often used to

  1. explore the complex behavior of a class, actor, subsystem or component etc...
  2. model real-time systems

Source: Concept of State Diagram in EclipseUML User Guide


State Diagram Illustrated
  1. Read the NCSU State Diagram Tutorial.csg web

  2. From within Eclipse, go to Help --> Help Contents --> EclipseUML User Guide --> Diagrams --> State Diagram. This was automatically installed when you installed EclipseUML. Carefully read the EclipseUML tutorial State Diagram.

    • Concept
    • Toolbar
    • State Diagram Example

TaskTopicAssignments

10

*.upd

Component Diagram

Component diagrams show the dependencies among software components, including the classifiers that specify them, such as implementation classes; and the artifacts that implement them, such as source-code files, binary-code files.

It is a simple, high-level diagram, which refers to physical components in a design. It is used to show how code is actually divided into modules. While package diagrams show logical or conceptual division, component diagrams are used to show physical division used for implementation.

A Component diagram shows the dependencies among software components, including source code, binary code and executable components. Some components exist at compile time, some exist at link time, and some exist at run time.

Components are physical units including:

  1. External libraries, COM components
  2. Enterprise JavaBeans and jar files
  3. Operating systems and virtual machines

Source: Concept of Component Diagram in EclipseUML User Guide


Component Diagram Illustrated
  1. From within Eclipse, go to Help --> Help Contents --> EclipseUML User Guide --> Diagrams --> Component Diagram. This was automatically installed when you installed EclipseUML. Carefully read the EclipseUML tutorial Component Diagram.

    • Concept
    • Drag'n'Drop
    • Toolbar
    • Component Diagram Example

TaskTopicAssignments

11

Object Diagram

An Object diagram shows the existence of objects, their relationships in the logical view of the system and how they execute a particular scenario or use case.

Object Diagram, also called instance diagram shows an overview of a system. Using the Object diagram model, you describe the static structure of the symbols in your system.

Source: Concept of Object Diagram in EclipseUML User Guide


  1. From within Eclipse, go to Help --> Help Contents --> EclipseUML User Guide --> Diagrams --> Object Diagram. This was automatically installed when you installed EclipseUML. Carefully read the EclipseUML tutorial Object Diagram.

    • Concept
    • Toolbar

TaskTopicAssignments

12

*.udd

Deployment Diagram

A UML Deployment diagram depicts a static view of the runtime configuration of hardware nodes and the software components that run on those nodes. It shows the configuration of run-time processing elements and the software components, processes, and objects. Software component instances represent run-time code units. Components that do not exist as run-time entities do not appear.

Developers can model the physical platforms and network connections to be used in their application. Nodes usually represents hardware platforms. Component diagrams can be placed on top of deployment diagrams to indicate which modules of code will go on which hardware platform.

Source: Concept of Deployment Diagram in EclipseUML User Guide


Deployment Diagram Illustrated
  1. From within Eclipse, go to Help --> Help Contents --> EclipseUML User Guide --> Diagrams --> Deployment Diagram. This was automatically installed when you installed EclipseUML. Carefully read the EclipseUML tutorial Deployment Diagram.

    • Concept
    • Toolbar
    • Deployment Diagram Example

TaskTopicAssignments

13

Documentation Generation
JavaDoc w/ UML Diagrams

Javadoc With UML Diagrams Illustrated
  1. Read the NCSU Javadoc Tutorial.csg web

  2. From within Eclipse, go to Help --> Help Contents --> Java Development User Guide --> Tasks. This was automatically installed as was the JDT (Java Development Tools) when Eclipse was installed. Carefully read the Eclipse tutorial Creating Java Documentation.

    • Selecting types for Javadoc generation
    • Configuring Javadoc arguments for standard doclet
    • Configuring Javadoc arguments

  3. From within Eclipse, go to Help --> Help Contents --> Java Development User Guide --> Reference --> Wizards --> Javadoc Generation. This was automatically installed as was the JDT (Java Development Tools) when Eclipse was installed. This is a user interface for the javadoc.exe tool available in the Java JDK, which allows you to generate Javadoc Generation.

  4. From within Eclipse, go to Help --> Help Contents --> EclipseUML User Guide --> Documentation Generation. This was automatically installed when you installed EclipseUML. Carefully read the EclipseUML tutorial Documentation Generation.

    • Launching the Documentation Generation
    • Templates
      • Content
      • Format

Primary Sources:

URL:   http://www.comscigate.com/    Last Revised:  December 24, 2007