a) the fact that collaboration diagrams illustrate how objects interact, and communication diagrams – how these objects interact;
b) do not differ: collaboration diagrams were simply renamed in UML 2.0;
c) the fact that collaborations have spatial organization on a plane, and communication diagrams have linear organization;
d) both a and c.
5. Sequence diagrams can model asynchronous and multi-threaded processes:
a) true;
b) false.
6. Interaction diagrams use transition condition to control when and which frame fragment is executed:
a) true;
b) false.
7. Alt operator called interaction operator or interaction frame:
a) is used to indicate an invalid fragment;
b) simulates additional behavior;
c) helps to realize a condition;
d) simulates parallel workflow.
8. Proper project should include both sequence diagrams and collaboration diagrams:
a) true;
b) false.
9. Object's focus control symbols are used to indicate:
a) object's life time on sequence diagram;
b) object's life time on communication diagram;
c) when an object is created;
d) nothing from above.
10. UML version 2.0 specification uses:
a) nested numbering scheme to indicate temporal order on sequence diagram;
b) nested numbering scheme to indicate temporal order on communication diagram;
c) flat nested numbering scheme to indicate temporal order on sequence diagram;
d) flat numbering scheme to indicate temporal order on communication diagram.
CHAPTER № 5
Statе Dіagram
Brief content:
Internal activity
Activity states
Superstates
Parallel states
State diagram (state machіne dіagrams) – it is a known technique to describe the behavior of the system. In one form or another state diagram there since 1960, and at the dawn of object-oriented programming are used to represent the behavior of the system. In object-oriented state diagram drawn single class to show the behavior of a single object in the course of his life.
The state diagram begins with the state of the object described by the controller. In the diagram this is indicated by a pseudo-primary (іnіtіal pseudostate) which is not a condition, but has an arrow pointing to the initial state. The chart also appear to rule according to which the object moves from one state to another. These rules are represented as a transition – lines connecting state.
Transition (transіtіon) means moving from one state to another. Each transition has a label that consists of three parts:
trigger-ID [protection] / activity.
All of them are optional. Typically, the trigger identifier – Thisis the only event that can cause a change of state. Protection, if specified, is the logical condition that must be satisfied that the transition occurred. Activity – isa behavior of the system during the transition. It can be any behavioral expression. The full form of the trigger identifier can include several events and parameters.
All three parts of the description of the transition is not optional. Skipping activity means that the transition does not occur. Pass protection means that the transition is always carried out if the trigger event occurs. Trigger ID offline rarely, this means that the transition is immediate, as can be seen mainly in states of activity.
When the specific state occurs in the event that this state can be accomplished only one transition. If you have multiple transitions for their protection should be mutually exclusive. If an event occurs, and allowed transitions no event is ignored.
The final state (fіnal state) means that the state machine has finished the work, which causes the removal of the object controller.
Finite state machines can display only those objects that are directly observed or act. When developers talk about objects, they often refer to the state of the object, referring to a combination of all of the data contained in the fields of objects. However, the state diagram of a finite automaton is a more abstract concept of state; the point is that different states require different ways of responding to events.
Internal activity
States can react to events without making the transition from the internal activity (іnternal actіvіtіes), in which case the event protection activity and are placed inside the rectangle state.
Figure 14 shows the state with internal activities of characters and events of assistance that can be seen in text fields editor UІ. Internal activity similar self-transitions (self transіtіon) – atransition that returns in the same state. Syntax internal activity is built on the same logic events, protection and treatment.
Figure 14 also shows the specific activity: the input and output activity. Input activity is performed every time when there is the entrance to the state; Output Activity – whenever the state is exited. However, activity was not initiated by the internal input and output activity; This is the difference between domestic activities and self-transitions.
Figure 14. Internal events shown in dialing text in the text field
Activity states
There are states in which the object shows some activity. Status Searchіng (search) in Figure 15 is such a state of activity (actіvіtu state): Senior Activity denoted DO /; hence the term DO actіvіtu. Once the search is complete, Goes without activity, such as screening of new equipment (Dіsplau New Hardware). If the activity occurs in the course of an event cancellation (cancel) the activity of a DO is interrupted and the object returns to the Hardware Update Wіndow (Update window hardware).
Figure 15. The state with activity
AND DO activity and normal activities are a manifestation of a behavior. The crucial difference between them lies in the fact that the usual activity occur «instantaneously» and can not be interrupted by the usual events, whereas the DO activity can be performed for a limited time and can be interrupted, as shown in Figure 15. The instantaneity for different systems is treated differently; for real-time systems it may take a few machine instructions, and to desktop software could be several seconds.
Superstates
It often happens that several states have common transitions and internal activities. In such cases, they can be converted into a substate (substates), and general behavior in the transfer superstate (superstate), as shown in Figure 16. Without the superstate would have to draw the transition cancel (cancellation) for all three states within the state Enter Connectіon Detaіls (Entry details compounds).
Figure 16. Superstate with nested substates
Parallel states
The states can be divided into several parallel states, launched at the same time. Fig. 17 shows a simple alarm clock, which may include a CD, or radio, and to show either the current time or alarm time.
Options CD / radio and the current time / alarm time are parallel.
Figure