230 likes | 243 Views
Learn about UML activity diagrams, how to read them, draw them, and understand their practical usage. Explore the main elements and different types of activity diagrams.
E N D
ACTIVITY DIAGRAMS 《UML面向对象建模基础》
Agenda • Overview of the Activity Diagram • How to read the Activity Diagram? • How to draw Activity Diagram? • Where to use Activity Diagrams? • Summary
Agenda • Overview of the Activity Diagram • How to read the Activity Diagram? • How to draw Activity Diagram? • Where to use Activity Diagrams? • Summary
Overview of the Activity Diagram • Activity diagram is another important diagram in UML to describe dynamic aspects of the system. • It captures the dynamic behaviour of the system. The activity diagram is used to show message flow from one activity to another. • Activity diagrams are a technique to describe procedural logic, business process, and work flow .It can be used to business process, workflow modeling, can also be used to modelcase or even program implementation. • In UML 2, activity diagrams were not seen as special Cases of state diagrams.
Agenda • Overview of the Activity Diagram • How to read the Activity Diagram? • How to draw Activity Diagram? • Where to use Activity Diagrams? • Summary
The Main Elements of the Activity Diagram • Initial nodandfinal node:With a solid circle to represent the initial node, with a circle plus a solid circle to represent the end of the event • Action:Is one of the most important elements of the activity diagram, which is used to represent an activity • Convert: When an activity is over, the control flow is immediately passed to the next active node, called "conversion" in the activity diagram, with a straight line with arrows
The Main Elements of the Activity Diagram • Flow/edge:The branch is represented by a diamond, and it has an entry transition (arrows are pointed out from the branch)One or more departures (arrows from the branchPointing out). And each will leave the conversion have a guard condition that is used to indicate what is satisfied condition when the implementation of the conversion. • join:
Complex Activity Diagram • Auxiliary activity diagram : • connector: you must use them in pairs: one with incoming flow, one with an outgoing flow, and both with the same label. But sometimes, you want to do some constraints, then you can use the description of the convergence to complete. The rendezvous description is actually a constraint, and its format is "{constraint condition}".
Complex Activity Diagram • Send signal and receive signal :
Complex Activity Diagram • Pin: Indicates the corresponding parameter of the action • 扩展区:
Agenda • Overview of the Activity Diagram • How to read the Activity Diagram? • How to draw Activity Diagram? • Where to use Activity Diagrams? • Summary
Draw Activity Diagram • “Activity diagram” is more intuitive and easy to understand; with the traditional flow chart is very similar, as long as you can read the activity diagram, it is not difficult to draw the activity diagram. • When deciding whether to use the swim lane first: mainly based on the activity diagrams to reflect the activities of the different implementers. • And then use the basic modeling elements such as join, merge to describe the activity control process. • If necessary, add the object stream and the state changes of the object, using some advanced modeling elements (such as auxiliary activity diagram, confluence description, send signal and receive signal, pin, extended area) to represent more information • The key to modeling the activity diagram is to show the control flow, and the other modeling elements are complementary to the purpose
Agenda • Overview of the Activity Diagram • How to read the Activity Diagram? • How to draw Activity Diagram? • Where to use Activity Diagrams? • Summary
Use Activity Diagrams • Modeling of Workflows: For business modeling, each swim lane represents a unit of responsibility, which effectively reflects the job responsibilities, the scope of business, and the relationship between the units, the information . • The following strategies should be followed when modeling: • Create a focus for the workflow, unless you are involved in the system is very small, it is impossible in a picture shows all the control flow in the system • Choose a business object with a high level of responsibility for all of the workflows and create a swim lane for each important business object • Identify the preconditions of the initial nodes of the workflow and the postconditions of the active endpoints, which effectively model the boundaries of the workflow.
Use Activity Diagrams • Start with the initial node of the workflow, illustrate the actions and activities that occur over time, and represent them as action in the activity diagram • Integrate complex activities or multiple occurrences of activities into an action and represent them through ancillary activity diagrams or sub-activity diagrams • Find the connection to these active nodes, first from the order of the workflow, and then consider the branch, and then consider the bifurcation and convergence • If the workflow involves important objects, you can also add them to the activity diagram • If there are multiple enablements in the workflow, you can use the expansion area
Use Activity Diagrams • Modeling the operation: Each object occupies a swim lane, and the activity is the member method of the object • The following strategies should be followed when modeling: -- the abstract concept involved in the collection operation, including the parameters of the operation, the type of return, the attributes of the class, and some neighboring classes -- the preconditions of the initial node that identifies the operation and the postcondition of the active end point. Also identify the information that must be maintained during the execution of the operation -- start from the initial node of the operation, describe the activities that occur over time, and represent them as actions in the activity diagram -- If necessary, use a branch to describe conditional statements and loop statements -- Only when this operation belongs to an active class, it is necessary to use bifurcation and convergence to illustrate the parallel control flow
Agenda • Overview of the Activity Diagram • How to read the Activity Diagram? • How to draw Activity Diagram? • Where to use Activity Diagrams? • Summary
Summary • First introduced the "activity diagram" of the historical changes; one by one to introduce a simple activity diagram, with swim lanes of the activity diagram, with the object flow of the activities of the reading method • It explains the basic modeling elements such as actions, initial nodes and activity final, flow, merge and fork, and gradually leads to control flow logic such as lane and object flow • Introduces the concept of auxiliary activity diagram, converging descriptions, sending signals and received signals, pins and expansion regions • Finally, a general description of the activities of the drawing points, combined with the workflow modeling and operational modeling of the similarities and differences between.