---
title: "Behavior modeling and four diagrams"
subject: "Object Oriented Analysis and Design"
chapter: 2
key: "semester_6/object_oriented_analysis_and_design:behavior-modeling-four-diagrams"
source: https://www.bctengineer.com/q/semester_6/object_oriented_analysis_and_design/behavior-modeling-four-diagrams
site: BCT Engineering
---

# Behavior modeling and four diagrams

Object Oriented Analysis and Design · Chapter 2: Object Oriented Analysis

- Asked in: 2070 Bhadra, 4+4 marks
- Video: [UML diagram types: structure and behavior diagrams (14 examples)](https://www.youtube.com/watch?v=3uZ16dwa0jg) — Gleek diagram maker
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/object_oriented_analysis_and_design/behavior-modeling-four-diagrams
- Whole chapter: https://www.bctengineer.com/md/semester_6/object_oriented_analysis_and_design/chapter-2

## Question

What is behavior modeling in object-oriented analysis? Present any four sample diagrams that are based on behavior modeling.

## Short answer

Behavior modeling captures dynamic system interactions over time. Four key diagrams: use case diagram shows actor functions; sequence diagram shows time-ordered messages; state machine diagram shows object states and transitions; activity diagram shows process flow with decisions and parallelism.

## Answer

**Behavior modeling** in OOA describes the *dynamic* side of the system: how objects interact, respond to events and change state over time, and how the system behaves from the user's point of view. It complements the static (structural) model of classes. The behaviour is captured in the sample diagrams below.

#### 1. Use case diagram (functional behaviour)
Shows actors and the functions the system provides to them.
```text
          +-------------------+
 [Customer]--( Withdraw Cash )|
          |-( Check Balance ) |
          +-------------------+
```

#### 2. Sequence diagram (interaction in time order)
Shows messages exchanged between objects in a scenario.
```text
 :Customer     :ATM       :Bank
     | enterPIN() |           |
     |----------->| verify()  |
     |            |---------->|
     |            |<- - - - - |
     |<- - - - - -|           |
```

#### 3. State machine (state) diagram
Shows the states of one object and the events that cause transitions.
```text
 (*)-->[ Idle ]--insertCard-->[ Verifying ]
          ^                       | pinOK
          +----- ejectCard ----[ Active ]
```

#### 4. Activity diagram
Shows the flow of activities, decisions and parallel work in a process.
```text
 (start)-->[Enter PIN]-->< valid? >--yes-->[Dispense]-->(end)
                            |no
                            +--->[Reject]-->(end)
```

A **collaboration (communication) diagram** is another behavioural diagram, showing the same interaction as a sequence diagram but organised by object links.

Use: behaviour models are used to find operations of classes, check use cases, and to design tests.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Behavior modeling describes:
   A. Only the class attributes
   B. The database schema
   C. How objects interact and change state over time
   D. The hardware nodes
   Answer: C. It is the dynamic side, complementing the static class model. (Key point: Behavior modeling meaning)

2. A use case diagram shows:
   A. Actors and the functions the system provides
   B. Object states
   C. Software components
   D. Message order between objects
   Answer: A. It captures functional behaviour from the user's view. (Key point: Use case diagram purpose)

3. A sequence diagram shows:
   A. Messages between objects in time order
   B. Class inheritance
   C. Parallel activities only
   D. States of one object
   Answer: A. It models interaction in a scenario over time. (Key point: Sequence diagram)

4. A state machine diagram shows:
   A. Deployment nodes
   B. Packages
   C. Actors and use cases
   D. States of one object and events causing transitions
   Answer: D. It models the life of a single object. (Key point: State diagram)

## Related in Object Oriented Analysis and Design

- [Define object; method implements behavior](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Adefine-object-method-behavior) — Object Oriented Analysis and Design, chapter 1
- [Object oriented system and core concepts](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Aoo-system-concepts-explained) — Object Oriented Analysis and Design, chapter 1
- [Algorithmic vs object-oriented decomposition](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Aalgorithmic-vs-oo-decomposition) — Object Oriented Analysis and Design, chapter 1
- [Forking, joining and branching in modeling](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Aforking-joining-branching-activity) — Object Oriented Analysis and Design, chapter 2
- [Domain modeling; attributes and associations guidelines](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Adomain-modeling-attributes-associations) — Object Oriented Analysis and Design, chapter 2
- [Requirement elicitation and system behavior](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Arequirement-elicitation-in-ooa) — Object Oriented Analysis and Design, chapter 2

## Related in other subjects

- [Compare procedural and object oriented programming](https://www.bctengineer.com/question.md?key=semester_3%2Fobject_oriented_programming%3Aprocedural-vs-oop-compare) — Object Oriented Programming, chapter 1
- [Why system modeling; weakness of structured analysis](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Asystem-modeling-importance) — Software Engineering, chapter 2
- [Present equivalent of fuel costs, actual dollar](https://www.bctengineer.com/question.md?key=semester_6%2Fengineering_economics%3Aactual-dollar-fuel-cost-waste-plant) — Engineering Economics, chapter 8
- [Position analysis of a four-bar mechanism](https://www.bctengineer.com/question.md?key=semester_6%2Ftheory_of_mechanism_and_machine_i%3Afour-bar-position-analysis-numerical) — Theory of Mechanism and Machine I, chapter 2
