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

Appendix A Small UML Guide

Figure A-23.  A state with internal transitions

Besides self-defined events, the following predefined events can optionally be used for internal transitions in order to execute some specified behavior:

•\ entry: A behavior that is performed upon entry to a state.

•\ do: An ongoing behavior that is performed as long as the modeled element is in the state.

•\ exit: A behavior that is performed upon exit from a state.

Trigger

A transition may own a set of so-called triggers. A trigger specifies an event whose occurrence, when dispatched, may trigger traversal of the transition. Triggers can be noted on a transition according to the following template:

[event1, event2, ...][condition][/behavior]

All elements, i.e. the explicit events, the so-called guard (that’s the part that contains the condition), as well as the executed behavior if a transition is triggered, are optional. Even if no explicit trigger is annotated at a transition, there is one. This implicit event is called a completion event and it signifies that all behaviors associated with the source state (e.g., the possibly existing behaviors that are associated with the entryand doevents) have completed execution.

Stereotypes

Among other ways, the vocabulary of UML can be extended with the help of so-called stereotypes. This lightweight mechanism allows the introduction of platformor domain-specific extensions of standard UML elements. For instance, by the application of the stereotype «Factory» on the standard UML element Class, designers can express that those specific classes are object factories.

474

Appendix A Small UML Guide

The name of an applied stereotype is shown within a pair of guillemets (French quotation marks) above or before the name of the model element. Some stereotypes also introduce a new graphical symbol, an icon. Table A-4 contains a list of the stereotypes used in this book.

Table A-4.  Stereotypes Used in This Book

Stereotype

Meaning

 

 

«Factory»

A class that creates objects without exposing the instantiation logic to the

 

client.

«Facade»

A class that provides a unified interface to a set of interfaces in a complex

 

component or subsystem.

«Include»

A stereotype applied to a directed relationship (dependency) to indicate that one

 

source code file requires the contents of another source code file.

«ModuleImport» A stereotype applied to a directed relationship (dependency) to indicate that a C++ source code file imports a C++ module, which is a set of source code files that were precompiled independently of the units that are importing the module.

«Subsystem»

A UML standard stereotype. It is used to mark a component that represents a

 

large-scale module within a system, which may have characteristics of a self-

 

contained system.

«SUT»

The System Under Test (SUT). Classes or components with this stereotype are

 

the entities to be tested, for example, with the help of unit tests.

«System»

This stereotype, which can be applied to both the UML component and the

 

class, marks the element that represents the so-called “system of interest,”

 

i.e., the entire software system.

«TestContext»

A software entity, for example, a class that acts as a grouping mechanism for a

 

set of test cases (see stereotype «TestCase»).

«TestCase»

An operation that interacts with the «SUT» to verify its correctness. Test cases

 

are grouped in a «TestContext».

 

 

475