Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
roth_stephan_clean_c20_sustainable_software_development_patt.pdf
Скачиваний:
29
Добавлен:
27.03.2023
Размер:
7.26 Mб
Скачать

Appendix A Small UML Guide

Message

A message is a communication between participants of an interaction in which a sender makes a request for either an operation call or signal reception by a receiver. Figure A-19 depicts different sorts of messages.

Figure A-19.  Different sorts of messages

The difference between a synchronous and asynchronous message is that with an asynchronous message, the sender can do other things immediately after the message has been sent (“fire and forget”). On the other hand, the sender of a synchronous message is blocked until the message recipient has finished processing the message and returns to the caller with a so-called Reply message.

An object creation message (depicted by a dashed line with an open arrow head pointing to the head of a lifeline) designates the creation of another lifeline object.

State Diagram

In addition to processes (depicted with the help of activity diagrams) and interactions (depicted with the help of sequence diagrams), a third aspect of behavior is the state and the change of states, i.e. event-driven behaviors of parts of a system. These states and transitions between states are usually modeled with the help of state machines and depicted in state diagrams. UML state machine is an object-based variant of Harel statechart [Harel87], adapted and extended by UML. Thus, it offers more possibilities than the traditional Finite State Machine (FSM).

471

Appendix A Small UML Guide

Figure A-20 depicts an example of a state diagram with the most common notation elements. The diagram frame represents the context of the state machine.

Figure A-20.  An example of a state diagram

State

The central element in state diagrams is the state.

STATE

A state models a situation during which some (usually implicit) invariant condition holds.

A state is depicted as a rectangle with rounded corners. A distinction is made between simple and composite states, as depicted in Figure A-21. The latter are states that have a region with sub-states, i.e. hierarchically nested states.

472