Section 9.5. Time


9.5. Time

For a type of diagram that is actually called a "timing" diagram, it might seem a little strange that we haven't yet mentioned time. So far, we've just been setting the stage, adding participants and the states that they can be put in, but to really model the information that's important to a timing diagram, it's now time to add time (pun intended).

9.5.1. Exact Time Measurements and Relative Time Indicators

Time on a timing diagram runs from left to right across the page, as shown in Figure 9-6.

Figure 9-6. Time measurements are placed on a timing diagram as a ruler along the bottom of the page


Time measurements can be expressed in a number of different ways; you can have exact time measurements , as shown in Figure 9-6, or relative time indicators , as shown in Figure 9-7.

Figure 9-7. Relative time indicators are particularly useful when you have timing considerations such as "ParticipantA will be in State1 for half of the time that ParticipantB is in State2"


In a timing diagram, t represents a point in time that is of interest. You don't know exactly when it will happen because it may happen in response to a message or event, but t is a way to refer to that moment without knowing exactly when it is. With t as a reference, you can then specify time constraints relative to that point t.

Adding time to the diagram we've been putting together so far is tricky because we don't have any concrete timing information in the original requirement. See the "Timing Constraints in System Requirements" section earlier in this chapter if you need a quick reminder as to what the extended Requirement A.2 states.

However, we still need to apply the constraints mentioned in Requirement A.2, so some measure of relative time represented by t is shown in Figure 9-8.

Figure 9-8. The timing constraints are a blend of exact and relative timings


In this figure, the initial stages of the interaction are simply measured as seconds, and the single t value represents a single second wherever it is mentioned on any further timing constraints on the diagram. See the "Timing Constraints" section later in this chapter for more on how the value t can be used on a timing diagram.




Learning UML 2.0
Learning UML 2.0
ISBN: 0596009828
EAN: 2147483647
Year: 2007
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net