UML 2 Diagrams

The 13 diagrams of UML 2

Structure(6):
Class Diagram
Object Diagram
Composite Structure Diagram
Component Diagram
Package Diagram
Deployment Diagram

Behavior(3):
Use Case Diagram
Activity Diagram
State Machine Diagram

Interaction(4):
Sequence Diagram
Communication Diagram
Timing Diagram
Interaction Overview Diagram

The 4+1 View

UML 4+1 View

Use Case View:
–Use Case Diagram

Logical View:
–Class Diagram
–Object Diagram
–Composite Structure Diagram
–Sequence Diagram
–Communication Diagram
–Timing Diagram
–Interaction Overview Diagram
–State Machine Diagram

Process View:
–Activity Diagram

Development View:
–Component Diagram
–Package Diagram

Physical View:
–Deployment Diagram

Relationship

UML Diagrams Relationship

Use Case Diagram

A use case diagram is a diagram that shows a set of use cases and actors and their relationships.

UML Use Case Diagram

Sample:

UML Use Case Diagram Example

Activity Diagram

An activity diagram shows the flow from activity to activity. An activity is an ongoing nonatomic execution within a state machine. The execution of an activity ultimately expands into the execution of individual actions, each of which may change the state of the system or communicate messages. Actions encompass calling another operation, sending a signal, creating or destroying an object, or some pure computation such as evaluating an expression.

Unlike a traditional flowchart, an activity diagram shows concurrency as well as branches of control.

UML Activity Diagram

Sample:

UML Activity Diagram Example

Swimlanes:

UML Activity Diagram Swimlanes

Class Diagram

A class diagram is a diagram that shows a set of classes, interfaces, and collaborations and their relationships.

UML Class Diagram

Object Diagram

An object diagram is a diagram that shows a set of objects and their relationships at a point in time. It is a snapshot of a running system.

UML Object Diagram

Sequence Diagram

Sequence diagrams are all about capturing the order of interactions between parts of your system. Using a sequence diagram, you can describe which interactions will be triggered when a particular use case is executed and in what order those interactions will occur.

UML Sequence Diagram

Sample:

UML Sequence Diagram Example

Communication Diagram

The main purpose of sequence diagrams is to show the order of events between the parts of your system that are involved in a particular interaction. Communication diagrams add another perspective to an interaction by focusing on the links between the participants .Both deriving from the same information in the UML’s metamodel, sequence diagrams and communication diagrams are semantically equivalent, with different points of view.

UML Communication Diagram

Sample:

UML Communication Diagram Example

Timing Diagram

Timing diagrams focus on detailed timing information, whereas sequence diagrams focus on message order and communication diagrams show the links between participants.

In a timing diagram, each event has timing information associated with it that accurately describes when the event is invoked, how long it takes for another participant to receive the event, and how long the receiving participant is expected to be in a particular state.

The concept of an object’s state is integral to timing diagrams since they show states of an object at particular times. State machine diagrams show in detail the states of an object and triggers that cause state changes. Both diagram types are very important to models of real-time and embedded systems.

UML Timing Diagram

Sample:

UML Timing Diagram Example

Alternative Notation:

UML Timing Diagram Example

Interaction Overview Diagram

Interaction overview diagrams provide a high-level view of how several interactions work together to implement a system concern, such as a use case. Sequence, communication, and timing diagrams focus on specific details concerning the messages that make up an interaction, but interaction overview diagrams tie together the different interactions into a single complete picture of the interactions that make up a particular system concern.

An interaction overview looks very much like an activity diagram except that each of the actions are interactions within their own right.

Sample:

UML interaction Overview Diagram

State Machine Diagram

A state machine is a behavior that specifies the sequences of states an object goes through during its lifetime in response to events, together with its responses to those events.

UML State Machine Diagram

Transaction (trigger [guard] / behavior):

UML State Machine Diagram Transaction

State:

UML State Machine Diagram State

Composite Structure Diagram

Composite structure diagrams model a class (or instance)’s internal structure and ports.

Class Diagram to Composite Structure Diagram:

UML Composite Structure Diagram

Modeling class (role: type) vs modeling instance (name / role : type):

Class Composite vs. Instance Composite - UML Composite Structure Diagram

Port and Interface:

Port and Interface - UML Composite Structure Diagram

Component Diagram

UML component diagrams model the components (can range from class to subsystem), which are the encapsulated, reusable, and replaceable parts of your software.

Component diagrams are the Composite Structure diagrams of the components.

UML Component Diagram

An <<artifacts>> section listing the artifacts, or physical files, manifesting this component, as in a Deployment diagram.

UML Component Diagram

Package Diagram

In UML, groups of classes are modeled with packages (in fact packages can organize almost any UML element not just classes). Most object-oriented languages have an analog of UML packages to organize and avoid name collision among classes. For example, Java has packages, C# has namespaces.

Folders are often used as packages in UML tools. In fact the most common use of UML package diagrams is to give an overview of the core packages in your software and the dependencies among them.

UML Package Diagram

Deployment Diagram

UML deployment diagrams show the physical view of your system, bringing your software into the real world by showing how software gets assigned to hardware and how the pieces communicate.

A deployment diagram shows the configuration of run time processing nodes and the artifacts that live on them.

UML Deployment Diagram

When designing software, you break it up into cohesive groups of functionality, such as components or packages, which eventually get compiled into one or more files or artifacts. In UML-speak, if an artifact is the physical actualization of a component, then the artifact manifests that component (you can specify artifacts in a component diagram). An artifact can manifest not just components but any packageable element, such as packages and classes. Earlier versions of UML draw components inside a node.

Nodes and Artifacts - UML Deployment Diagram

Reference

UML 2 Composition Model
http://www.jot.fm/issues/issue_2004_11/column5/

Related posts:

This entry was posted in Engineering and tagged . Bookmark the permalink.

2 Responses to UML 2 Diagrams

  1. Pingback: UML (Unified Modeling Language) | Warren Tang's Blog

  2. Pingback: UML Diagram Types With Examples for Each Type of UML Diagrams

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>