tailieunhanh - PATTERNS OF DATA MODELING- P44

PATTERNS OF DATA MODELING- P44: Models provide the means for building quality software in a predictable manner. Models let developers think deeply about software and cope with large size and complexity. Developers can think abstractly before becoming enmeshed in the details of writing code. Although models are beneficial, they can be difficult to construct. That is where patterns come in. Patterns provide building blocks that help developers construct models faster and better. | 202 Chapter 15 State Diagrams AM. Thus a Stimulus is a specific occurrence that conforms to the general description of its StimulusType. A State is the period in which an Entity waits for the next Stimulus. For example Joe Smith has placed his order and the order is in the StateType of OrderAcknowledged awaiting completion of verification. Similar States are described by a common StateType. All Stimuli are ignored in a State except those for which a StateDiagram prescribes behavior. Each Entity can have many States over time but has exactly one State at a time. A StateDiagram has no memory of the past and responds to Stimuli solely on the basis of an Entity s current State. Note the contrast between Stimulus and State. A Stimulus represents a point in time. A State represents an interval of time. A Transition is an instantaneous change from a source State to a target State. A Transition happens when a Stimulus occurs and the Entity s current State and the Stimulus matches the types specified for the TransitionType. The Transition causes the Entity to shift to the target State. Multiple Entities may be caused to Transition by the same Stimulus. The StateDiagram and Scenario models use the ItemDescription and Homomorphism templates see Chapter 5 . Chapter Summary A state diagram specifies the permissible states and stimuli that cause changes of state. A scenario executes a state diagram and can store the current state as well as the past history. State diagrams are helpful for situations where there is a lifecycle or a meaningful sequence of steps to enforce. Developers typically realize state diagrams by writing the equivalent procedural code. But another option is to have a generalized interpreter based on the models in this chapter. Bibliographic Notes I have used declarative state diagrams on several industrial consulting projects. This chapter was motivated by Chapter 6 of Silverston-2009 . Silverston and Agnew discuss the notion of data status which can be

TỪ KHÓA LIÊN QUAN