---
title: "Short note: Polymorphic signal"
subject: "Object Oriented Analysis and Design"
chapter: 2
key: "semester_6/object_oriented_analysis_and_design:short-note-polymorphic-signal"
source: https://www.bctengineer.com/q/semester_6/object_oriented_analysis_and_design/short-note-polymorphic-signal
site: BCT Engineering
---

# Short note: Polymorphic signal

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

- Asked in: 2069 Bhadra, 5 marks
- 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/short-note-polymorphic-signal
- Whole chapter: https://www.bctengineer.com/md/semester_6/object_oriented_analysis_and_design/chapter-2

## Question

Write a short note on Polymorphic signal.

## Short answer

A polymorphic signal combines UML signals (asynchronous messages) with polymorphism: the same signal sent to different objects invokes class-specific behavior. Signals can form a generalization hierarchy; a transition triggered by a parent signal also fires for child signals. This decouples sender from receiver types, allowing new signal subtypes or receiver classes without changing the sender.

## Answer

(Interpreted as the polymorphism of **signals/messages** in UML: the same signal or message can be sent to different objects, and each reacts in its own way, depending on its class.)

A **signal** is an asynchronous message that one object sends to another to notify it that something has happened; the sender does not wait for a reply. It is shown as a class with the stereotype `<<signal>>`. Signals can be organised in a generalization hierarchy, just like classes.

**Polymorphism** means "many forms": the same message results in different behaviour according to the receiving object's class. A **polymorphic signal** combines the two ideas:
- In a state machine, a transition triggered by a general signal is also triggered by any of its child signals. For example, a transition on `Alarm` also fires when `FireAlarm` or `GasAlarm` arrives.
- A signal can be sent to a general receiver (a superclass or interface), and each subclass supplies its own handler, so the response differs.

```text
        <<signal>>
        Alarm
           ^
     +-----+------+
  FireAlarm    GasAlarm       (signal hierarchy)

 Sender --alarm--> Device
   Device:HomeSystem -> rings bell
   Device:Factory    -> shuts valves
```

**Example:** `draw()` sent to a `Shape` reference executes `Circle.draw()` or `Square.draw()` depending on the actual object. This keeps the sender independent of the receivers' types, so new receivers (or new child signals) can be added without changing the sender.

## Check yourself

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

1. What is a signal in UML?
   A. A synchronous call waiting for return
   B. An asynchronous message notifying another object that something happened, shown with the stereotype <<signal>>
   C. A class attribute
   D. A database table
   Answer: B. The sender does not wait for a reply. (Key point: Signal definition)

2. What does polymorphism mean for messages?
   A. The same message gives different behaviour depending on the receiving object's class
   B. Different messages give the same result
   C. Messages cannot be inherited
   D. Only one receiver is allowed
   Answer: A. E.g. draw() runs Circle.draw() or Square.draw(). (Key point: Polymorphism)

3. How can a signal hierarchy act polymorphically?
   A. A subtype of a signal (FireAlarm) can trigger the same transition as its parent signal (Alarm)
   B. Signals cannot be organised in hierarchy
   C. Subtype signals are ignored
   D. Only the superclass can send
   Answer: A. Signals can be organised in generalization hierarchy like classes. (Key point: Signal hierarchy)
