tailieunhanh - Lecture Software design and architecture – Chapter 26

Lecture 26 – State machine diagram. In this chapter, the following content will be discussed: UML behavioral diagrams, sequence diagram, UML behavioral diagrams, state machine diagram, elements of a state machine diagram, creating a state machine diagram. | SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26 Review UML behavioral Diagrams Sequence diagram Outline UML Behavioral Diagrams State Machine Diagram Elements of a State Machine Diagram Creating a State Machine Diagram State Machine Diagram Some of the classes in the class diagrams are quite dynamic in that they pass through a variety of states over the course of their existence. For example, a vehicle can change over time from being “new” to “pre-owned,” on the basis of its status with the dealership. State Machine Diagram A behavioral state machine diagram is a dynamic model that shows the different states that a single class passes through during its life in response to events, along with its responses and actions. State Machine Diagram What objects are best used with state diagrams? large, complex objects with a long lifespan domain ("model") objects not useful to do state diagrams for every class in the system! State Machine Diagram Typically, behavioral state machine diagrams are . | SOFTWARE DESIGN AND ARCHITECTURE LECTURE 26 Review UML behavioral Diagrams Sequence diagram Outline UML Behavioral Diagrams State Machine Diagram Elements of a State Machine Diagram Creating a State Machine Diagram State Machine Diagram Some of the classes in the class diagrams are quite dynamic in that they pass through a variety of states over the course of their existence. For example, a vehicle can change over time from being “new” to “pre-owned,” on the basis of its status with the dealership. State Machine Diagram A behavioral state machine diagram is a dynamic model that shows the different states that a single class passes through during its life in response to events, along with its responses and actions. State Machine Diagram What objects are best used with state diagrams? large, complex objects with a long lifespan domain ("model") objects not useful to do state diagrams for every class in the system! State Machine Diagram Typically, behavioral state machine diagrams are not used for all classes, but just to further define complex classes to help simplify the design of algorithms for their methods. The behavioral state machine diagram shows the different states of the class and what events cause the class to change from one state to another. State Machine Diagram In comparison to the sequence diagrams, behavioral state machine diagrams should be used if you are interested in understanding the dynamic aspects of a single class and how its instances evolve over time, and not with how a particular use case scenario is executed over a set of classes. Elements of a Behavioral State Machine Diagram State A state is a set of values that describes an object at a specific point in time, and it represents a point in an object’s life in which it satisfies some condition, performs some action, or waits for something to happen. Elements of a Behavioral State Machine Diagram A state is depicted by a state symbol, which is a rectangle with rounded corners with a .