Signals
Signals are often used in event-driven systems and distributed computing environments. For example, a communications system might contain a Pager class, whose objects wait for, and respond to, Page signals. Signals differ from other message types in that when an object receives a signal, the object does not need to return anything, but reacts to the receipt of a signal according to the behavior specified by its receptions.
All signals are assumed to have a send( ) operation. A signal’s attributes represent the data it carries in its send operation. Signals can have no other operations.
You can add signals to the class diagrams in your model to represent the following functions:
- Trigger events in objects in models that represent event-driven systems
- Exceptions thrown by an operation when something unexpected occurs in a software system
A signal has a name describing its purpose in the system. As the following figure illustrates, the UML notation for a signal is a rectangle with two compartments.