0.5.8 Activity Partitions and Swimlanes

Sometimes You Need to Show Who Is Responsible for Each Action

A normal UML activity diagram can show:

  • actions;
  • decisions;
  • paths;
  • start and end points.

A web interaction introduces another useful question:

For example:

  • the browser creates the request;
  • the server processes the request;
  • the browser displays the response.

A UML activity diagram can make those responsibilities visible using activity partitions, often called swimlanes.

A Swimlane Groups Actions by Responsibility

Imagine two vertical lanes:

Sequence diagram showing Browser Server, then Start, then Create request, then Receive request, then Process request, then Create response.
BrowserServer.
  • New
  • Changed
  • Removed

The arrows can cross lane boundaries.

That crossing is useful because it shows information or control moving from one responsible participant to another.

Partitions Do Not Mean Separate Programs Must Be Drawn Independently

The diagram still represents one overall activity.

The partitions organize responsibility within that activity.

The Browser and Server lanes are not two unrelated diagrams.

They are two participants in one process.

Put Each Action in the Lane of the Performer

Suppose the action is:

Activity diagram showing Browser Server, then Send request Receive request, then Receive response Send response.
BrowserServer.
  • New
  • Changed
  • Removed

Those crossings are some of the most informative parts of the model.

They show where responsibility moves between systems.

Keep Actions Separate From Messages

An action might be:

Send request

The request itself is the information being communicated.

Likewise:

Send response

is an action.

The response is the information being sent.

At this introductory level, the activity diagram focuses primarily on actions and flow rather than trying to model every protocol field inside the message.

Use Partitions Only When Responsibility Matters

A swimlane diagram adds information.

It also adds visual structure.

If every action belongs to the same participant, partitions may not help.

They are especially useful for web interactions because client and server responsibilities are central to the concept.

A Soccer Website Example

Imagine a browser visiting a soccer club page.

The Browser lane might contain:

  • Interpret URL
  • Send request
  • Receive response
  • Display page

The Server lane might contain:

  • Receive request
  • Locate or generate page content
  • Send response

The same process without lanes can show order.

The lanes add:

Read Across the Lanes

When reading a partitioned activity diagram:

  1. Find the start node.
  2. Identify which lane contains the first action.
  3. Follow the flow.
  4. Notice every time the arrow crosses into another lane.
  5. Ask what responsibility changed at that handoff.
  6. Continue until the end node.

Do not read one complete lane top-to-bottom and then move to the next.

Follow the arrows through the process.

Partitions Can Represent More Than Computers

A partition can represent a:

  • person;
  • role;
  • department;
  • software component;
  • external system.

In this module, the most useful partitions are:

  • Browser/Client
  • Server

Later diagrams may use partitions when other responsibility boundaries matter.

The Main Purpose

An activity diagram already answers:

Partitions add:

That makes them a strong fit for modeling a web request and response.