打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
What is Timing Diagram? (什麼是時序圖)

转贴: Visual Paradigm Guide

Timing diagrams are UML interaction diagrams used to show interactions when a primary purpose of the diagram is to reason about time.

Timing diagrams focus on conditions changing within and among lifelines along a linear time axis. Timing Diagrams describe behavior of both individual classifiers and interactions of classifiers, focusing attention on time of occurrence of events causing changes in the modeled conditions of the Lifelines.

Time Diagram at a Glance

State Timeline Representation

Changes from one state to another are represented by a change in the level of the lifeline. For the period of time when the object is a given state, the timeline runs parallel to that state. A change in state appears as a vertical change from one level to another. The cause of the change, as is the case in a state or sequence diagram, is the receipt of a message, an event that causes a change, a condition within the system, or even just the passage of time.

Value lifeline Representation

The figure below shows an alternative notation of UML Timing diagram. It shows the state of the object between two horizontal lines that cross with each other each time the state changes.

Basic Concepts of Timing Diagrams

Major elements of timing UML diagram - lifeline, timeline, state or condition, message, duration constraint, timing ruler.

Lifeline

A lifeline in a Timing diagram forms a rectangular space within the content area of a frame. Lifeline is a named element which represents an individual participant in the interaction. It is typically aligned horizontally to read from left to right.

Multiple lifelines may be stacked within the same frame to model the interaction between them.

State Timeline in Timing Diagram

A state or condition timeline represents the set of valid states and time. The states are stacked on the left margin of the lifeline from top to bottom.

The cause of the change, as is the case in a state or sequence diagram, is the receipt of a message, an event that causes a change, a condition within the system, or even just the passage of time.

Multiple Compartments

It is possible to stack several life lines of different objects in the same timing diagram. One life line above the other. Messages sent from one object to another can be depicted using simple arrows. The start and the end points of each arrow indicate when each message was sent and when it was received.

State Lifeline

A state lifeline shows the change of state of an item over time. The X-axis displays elapsed time in whatever units are chosen while the Y-axis is labelled with a given list of states. A state lifeline is shown below:

Value Lifeline

A value lifeline shows the change of value of an item over time. The X-axis displays elapsed time in whatever units are chosen, the same as for the state lifeline. The value is shown between the pair of horizontal lines which crosses over at each change in value.

Timeline and Constraints

We can use the length of a timeline to indicate how long the object remains in a particular state by reading it from left to right. To associate time measurements, you show tick marks online the bottom part of the frame.

The example below shows that the Login event is received three time units after the start of the sequence. To show relative times, you can mark a specific instance in time using a variable name. The figure marks the time the sendMail event is received as time

You can use relative time marks in constraints to indicate that a message must be received within a specified amount of time.

State and Value Lifeline Side-by-Side

State and Value Lifelines can be put one after the other in any combination. Messages can be passed from one lifeline to another. Each state or value transition can have a defined event, a time constraint which indicates when an event must occur, and a duration constraint which indicates how long a state or value must be in effect for.

Model Consistency among Interaction Diagrams

Timing diagram should always be consistent with the relevant sequence diagram and state machine. To do this we can attach states in the lifeline for each of the objects in the sequence diagram. We can then derive the corresponding timing diagram much easier by inspecting the message passing between the objects against the states attached in the lifeline. The Carpark example below shows the model consistency between two interaction diagrams.

The figure above shows a sequence diagarm of the car park example, while the figure below presents the corresponding timing diagram of the car park example. The various parts of the timing diagram refer to the content of sequence diagram.

Related Links


  1. What is Unified Modeling Language?
  2. A list of UML & SysML tools
  3. Try Visual Paradigm FREE
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
UML顺序图介绍[译】
UML建模之时序图(Sequence Diagram)
Holub Associates: UML Reference Card
隐马尔科夫模型HMM自学 (5-2)Viterbi Algorithm
[Forward]静态时序分析(Static?Timing?Analysis)1
one time是'一次',two times是'两次',那two-time是什么意思?
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服