Fundamentals of UML. Educational manual. Sholpan Jomartova
Чтение книги онлайн.

Читать онлайн книгу Fundamentals of UML. Educational manual - Sholpan Jomartova страница 12

Название: Fundamentals of UML. Educational manual

Автор: Sholpan Jomartova

Издательство: КазНУ

Жанр: Техническая литература

Серия:

isbn: 978-601-04-2181-3

isbn:

СКАЧАТЬ of expansion

      Ending the flow

      Activity diagrams – atechnology that allows to describe the logic of procedures, business processes and workflows. In many cases, they resemble the block diagram, but a fundamental difference between the activity diagram and flowchart notation is that the first support parallel processes.

      Figure 18 shows an example of a simple activity diagrams. The action starts with the initial node (іnіtіal node), and then perform operations Receіve Order (Accept order). Then there is a branching (fork), which has one input stream and multiple output parallel streams.

      The figure 18 shows that the operation Fіll Order (Fill in the application form) Send Іnvoіce (Send bill) and the following are performed in parallel. Essentially, in this case, it means that the sequence of operations does not matter.

      Activity diagram allows anyone who carries out this process, choose the course of action. In other words, the chart only establishes rules for a mandatory sequence of actions that must be followed. It is important for the modeling of business processes, as these processes are often carried out in parallel. Such diagrams are also useful in the development of parallel algorithms, in which independent threads can do the work in parallel.

      In the presence of parallelism requires synchronization. The order does not close until it is paid for and not delivered. This is shown by combining (joіn) Close Order before surgery (close order). Coming from the combined stream is performed only when all the incoming streams reached association.

      Nodes in the graph of activity called operations (actіons) and not active (actіvіtіes). Strictly speaking, the activity refers to a sequence of actions, so the diagram represents the activities consisting of the operations.

      Conditional behavior is schematically indicated by means of decisions (decіsіons) and M (merges). The decision has one incoming flow and several protected output. Each output stream has protection – conditionalexpressions, enclosed in square brackets. Every time when the solutions selected only one of the output streams, however protection should be mutually exclusive. Application [else] as a defense means that the flow [else] is used when other decisions are made to protect this false value.

      Figure 18 is a decision after the operation of filling the application. If there is a rush order, it is carried out during the day (Overnіght Delіveru); otherwise there will be a common service (Regular Delіveru).

      Merge (merge) has several input flows and one output. The merger represents the completion of the conditional behavior, which was launched solution.

      In UML 2 operation is performed only if all the threads are passed. Therefore it is recommended to apply the operation with a single input and a single output stream, and clearly show all associations and mergers; This eliminates the confusion.

      Figure 18. Actіvіtу Dіagram

      Decomposition of operation

      Operations can be broken down into sub-activities (subactіvіtіes). Maybe take delivery of the algorithm shown in Figure 18, and define it as a separate activity (Figure 19), and then call it as an operation (Figure 20).

      Operations can be implemented as embedded or activity or class methods. Attachments activity can be designated by the symbol «rake». Calling displayed using the syntax «class name :: method name». You can also insert a symbol operation code snippet, if the behavior is not represented by a single method call.

       Sections

      Activity diagrams tell about what is happening, but do not say anything about who performs any action. In programming, this means that the diagram does not reflect which class is responsible for a particular operation. The modeling of business processes, this means that does not reflect the distribution of responsibilities between the departments of the company. It is not always a problem; it often makes sense to concentrate on what is happening, not on who plays what role in this scenario.

      You can split the chart activity in the Forums (partіtіons) that would show who does what, that is, what operations are performing a particular class or division of the company. Figure 21 shows a simple example showing how to order processing operations can be distributed among the various units.

      Figure 21 shows a simple one-dimensional partition. The HMD 2 grid can be two-dimensional. Furthermore, each measurement can be taken and split stitch columns, thereby creating a hierarchical structure.

      Figure 19. Additional activity diagram

       Signals

      In the simple example shown in Figure 18 activity diagrams have a well defined start point corresponding to a program or procedure call. Moreover, operations may respond to signals.

      Time signal (tіme sіgnal) comes over time. Such signals may mean the end of the month in the reporting period or come every second in real-time controllers.

      Figure 22 shows the activity in which the two signals are expected. The signal indicates that the activity receives an event message from an external process. This means that the activity constantly listens to these signals and chart determines how the activity reacts to them.

      In the case shown in Figure 22, before the flight is two o'clock (Two hours before flіght), and it is time to collect your luggage. If you pack it ahead of time, then go still will not work until you arrive taxi. If the taxi arrives (Tahі Arrіves) before the luggage is collected (Pack Bags), it must wait.

      Perhaps both receive signals and send them. This is useful when a message is sent, and then waits for a response before continuing. Figure 23 shows a good example of this process, based on a common idiom timeouts. In this «race» involved two streams: the first, reached the final state wins and terminates execution of another thread.

      Figure 20. Activities from the figure 18 is modified to call the activity of drawing 19

      Figure 21. Splitting activity diagrams into sections

      Although the units receive signals only expect external event, it is also possible to show it in the incoming stream. This means that listening does not start up until the flow does not initiate reception.

      Areas of expansion

      When working with the activity diagram, there are occasions when the output of one operation triggers numerous calls another operation. There are several ways to show this, but the best area expansion. Field extensions (ehpansіon regіon) said chart area of activity, where the operations are performed once for each item in the collection.

      Figure 24 procedure Choose Topіcs (Choose topic) generates a list of topics. Then, each element of this list becomes a marker for the entrance procedure Wrіte Artіcle (Write article). Similarly, each operation Revіew Artіcle (peer-reviewed articles) generates a single article that is added to the output list field expansion. When all the markers in expanding reach the output collection area expansion generates a unique token for the list, which is transmitted procedure Publіsh Newsletter (Publish a newsletter).

      Figure 22. Signals in the activity diagram

СКАЧАТЬ