标签:
Behavioral Diagrams
The UML’s behavioral diagrams are used to visualize, specify, construct, and document the dynamic aspects of a system. You can think of the dynamic aspects of a system as representing its changing parts. Just as the dynamic aspects of a house encompass airflow and traffic through the rooms of a house, so too do the dynamic aspects of a software system encompass such things as the flow of messages over time and the physical movement of components across a network.
行为图
UML的行为图被用于可视化、具体化,结构化和文档化系统动态的方面。你可以将系统动态的方面想象成表达它正在改变的部分。就像一个房子动态的方面包括空气流通和房子里的房间之间的连通,一个软件系统动态的方面同样也包括诸如随着时间流动的消息流和在网络中移动的组件这类的事物。
The UML’s behavioral diagrams are roughly organized around the major ways you can model the dynamics of a system.
1.Use case diagram
Organizes the behaviors of the system
2.Sequence diagram
Focuses on the time ordering of messages
3.Communication diagram
Focuses on the structural organization of objects that send and receive messages
4.State diagram
Focuses on the changing state of a system driven by events
5.Activity diagram
Focuses on the flow of control from activity to activity
UML的行为图大致有以下几类,它们是你可以建模系统动态方面的主要途径:
1.用例图
组织系统的行为
2.序列图
重点是以时间为顺序的消息
3.通讯图
重点是对象的结构组织发送和接收消息
4.状态图
重点是通过事件驱动系统状态的改变
5.活动图
重点是活动与活动之间的控制流动。
Use Case Diagram A use case diagram shows a set of use cases and actors (a special kind of class) and their relationships. You apply use case diagrams to illustrate the static use case view of a system. Use case diagrams are especially important in organizing and modeling the behaviors of a system.
Interaction diagram is the collective name given to sequence diagrams and communication diagrams. All sequence diagrams and communication diagrams are interaction diagrams, and an interaction diagram is either a sequence diagram or a communication diagram. These diagrams share the same underlying model, although in practice they emphasize different things. (Timing diagrams are another kind of interaction diagram that are not covered in this book.)
用例图
用例图显示一组用例与参与者(一种特殊的类)及其它们的关系。使用用例图来说明系统静态的用例视图。用例图在组织与建模系统行为时尤其重要。
协作图是序列图和通讯图的统称。所有序列图和通讯图都是协作图,协作图要么是序列图,要么是通讯图。这些图共享同一个基本模型,尽管在实际中他们的侧重点并不相同。(时序图是另一种协作图,在本书中不作介绍)。
Sequence Diagram A sequence diagram is an interaction diagram that emphasizes the time ordering of messages. A sequence diagram shows a set of roles and the messages sent and received by the instances playing the roles. You use sequence diagrams to illustrate the dynamic view of a system.
序列图
序列图是侧重消息时间顺序的协作图。序列图显示一组角色,还显示实例扮演的角色发送和接收消息。使用序列图来说明系统动态的视图。
Communication Diagram A communication diagram is an interaction diagram that emphasizes the structural organization of the objects that send and receive messages. A communication diagram shows a set of roles, connectors among those roles, and messages sent and received by the instances playing the roles. You use communication diagrams to illustrate the dynamic view of a system.
通讯图
通讯图是一个侧重对象组织结构发送和接收消息的协作图。通讯图显示一组角色、这些角色之间的连接器和实例扮演的角色发送和接收消息。使用通讯图来说明系统动态的视图。
State Diagram A state diagram shows a state machine, consisting of states, transitions, events, and activities. You use state diagrams to illustrate the dynamic view of a system. They are especially important in modeling the behavior of an interface, class, or collaboration. State diagrams emphasize the event-ordered behavior of an object, which is especially useful in modeling reactive systems.
状态图
状态图显示一个状态机、状态的组成、事务、事件和活动。使用状态图来说明系统动态的视图。它们在建模接口、类或是交互的行为时尤其重要。状态图侧重一个对象的事件序列行为,对反应式系统的建模尤其有用。
Activity Diagram An activity diagram shows the flow from step to step within a computation. An activity shows a set of actions, the sequential or branching flow from action to action, and values that are produced or consumed by actions. You use activity diagrams to illustrate the dynamic view of a system. Activity diagrams are especially important in modeling the function of a system. Activity diagrams emphasize the flow of control within the execution of a behavior.
活动图
活动图显示计算内的步骤流。活动显示一组操作,从一个操作到另一个操作的顺序流或是分支流,通过操作所产生或消耗的值。在建模功能型系统时,使用活动图尤其重要。活动图重点在执行行为的控制流。
Note: There are obvious practical limitations to illustrating something that’s inherently dynamic (the behavior of a system) using diagrams (inherently static artifacts, especially when you draw them on a sheet of paper, a whiteboard, or the back of an envelope). Rendered on a computer display, there are opportunities for animating behavioral diagrams so that they either simulate an executable system or mirror the actual behavior of a system that’s executing. The UML allows you to create dynamic diagrams and to use color or other visual cues to “run” the diagram. Some tools have already demonstrated this advanced use of the UML.
备注:使用图(天生的静态表现,特别是你在纸上、白板上、一张信封的背面画它们的时候)来说明动态(系统的行为)特性有明显的现实局限性。行为图能生动的显示在计算机的显示器上,这个机遇使得它们可以模拟执行系统或是反映一个正在运行系统的实际行为。UML允许你创建动态图,允许你使用颜色或是其它可视的提示来“运行”这个图。一些工具已经表现了这一UML先进的应用。
标签:
原文地址:http://blog.csdn.net/listen_snow/article/details/45574499