Skip to main content

Short note: Focus of control

Short answer

Focus of control is a thin vertical rectangle on a lifeline in a UML sequence diagram, showing the period an object is active, either executing code or waiting for a called operation. It begins when a message arrives and ends when control returns.

Write a short note on Focus of control.

Focus of control (activation) in a UML sequence diagram shows the period during which an object is performing an action, i.e. when it has control, either executing its own code or waiting for a called operation to return.

Notation

A thin vertical rectangle drawn on the object's lifeline, starting when the object receives a message and ending when it finishes and returns control. It is also called an activation bar (UML 1) or an execution specification (UML 2).

 :Client       :Server       :Database
    |  request()  |              |
    |------------>|              |
    |            [ ]  query()    |
    |            [ ]------------>|
    |            [ ]            [ ] execute
    |            [ ]<- - - - - -[ ]
    |<- - - - - -[ ]             |

The bars show that Server is active from receiving request() until it replies, and Database only for the duration of query().

Points

  • The lifeline (dashed line) shows existence; the bar shows activity.
  • Nested bars on the same lifeline show a self call (recursion).
  • It shows which object controls the flow at any time, helps identify the duration of operations and the nesting of calls, and in procedural systems shows who holds the thread of control.
  • For a synchronous call, the caller's bar continues until the callee returns; for an asynchronous call, the caller's bar may end or continue independently.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Object Oriented Analysis and Design chapter 2 questions →