A state invariant is a condition that is placed on a lifeline. It specifies that the
pertaining instance fulfills the condition upon the next event occurring on that
lifeline (e.g., sending or receiving a message).
212 CHAPTER 3 UML??”Unifi ed Modeling Language
The condition is denoted within curly brackets on a lifeline. The expression
can optionally be written within a comment symbol, which is then attached to
the lifeline ( Figure 3.80 ).
The third notation option explains the name of the state invariant. If the condition
is formulated so that it describes a state from a state machine of the instance
that belongs to the lifeline, then you can place the state symbol directly on the
lifeline ( Figure 3.80 ).
3.8.7 Time Constraints
UML knows a simple time model. It includes an option to describe and to measure
a point in time or a period of time. The measured values can then be used to
formulate time constraints.
FIGURE 3-79
Example for a lifeline decomposition.
sd Read card
:Card
ref
ref
:Card reader
ref Create customer
data
Trigger card reset
Change protocol
Command1
Response1
Response1
new()
sd Create customer data (section Response1)
:CardProtocol
Customer name
:Customer data
213
This time model is not limited to interactions; it can also be used in other
model areas.
Pages:
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405