UML Final Review question--2.3:uml state Diagram

Source: Internet
Author: User

State diagram of the third problem

Key concepts:

1. Definition: Events, states, and transitions:

Event: Refers to the occurrence of something worth noticing .

State: Refers to the situation in which an object is at some point in time between the occurrence of an event.

Conversions: A relationship between two states. It indicates that when an event occurs, the object transitions from the previous state to the later state.

2. State-independent and state-dependent objects

If an object's response to an event is always the same, the object is considered to be independent of the event State (or non-modal). For example, if an object receives a message and the method that responds to the message always does the same thing, the object is independent of the message state. If, for all events, the response of an object is always the same, the object is a state-independent object .

Conversely, state dependent objects respond to events differently depending on the state or pattern of the object .

3. Relevant guidelines:

A. Consider establishing a state machine diagram for a state dependent object with complex behavior rather than a state-independent object

B. Generally speaking, the business information System usually has only a few complex state-dependent classes, so the state machine modeling usually has little effect. In contrast, there are often many state-dependent objects in areas such as Process control, device control, protocol processing, and communication . If you work in these areas, you should be familiar with and consider using state machine modeling.

4. A state diagram is primarily used to describe the dynamic behavior of an object during its lifetime , as a sequence of states that an object undergoes, an event that causes a state transition,and an action (action) that is accompanied by a state transition. It is generally possible to model the life cycle of an object with a state machine, which is used to display the state machine , with emphasis on the flow of control describing the state diagram .

5. Drawing the state machine diagram step

The ideal step for drawing a state machine diagram is to look for the main state, to determine the transitions between states, to refine the activities and transformations within the state, and to expand the details with a composite state.

A. look for the main status : for the flight ticket reservation system, it is obvious that there are mainly--there are obviously no bookings when the aircraft plan is confirmed, and it will be in this "no-booking" status until the ticket is booked-there is obviously a "partial booking" and "reservation" for the reservation Two states--and when the flight is about to take off, it is clear that a "book off" summary is available in four main states: No reservation, partial bookings, bookings and closed bookings

B. determine the transitions between States . table to indicate: The table landscape is turned out, table portrait is transferred to

C. Activities and transformations within the refinement state

D. Using composite states

6.5 Elements of conversion:

• Source Status: The state affected by the transition

• Target State: The state of the object when the conversion is complete

• Trigger event: Used to define an event for the transformation, including call, change, signal, time four types of events

• Guardianship Condition: Boolean expression that determines whether the conversion is activated,

• Action: Action when conversion is active

Draw points:

Specific methods See: http://www.cnblogs.com/ywqu/archive/2009/12/17/1626043.html

Http://www.cnblogs.com/sura/archive/2012/07/01/2572083.html

Here, a direct reference to two of what I think has been said in a very detailed introduction.

The first one is more conceptual, the second is more, and can be understood according to different needs.

Precautions:

A. notice what the state diagram's object is. It may be a system, a use case, or an object, so be sure to look at the state diagram of what the topic requires .

B. A state diagram of a drawing system and a use case is usually the process of drawing it, while the state diagram of the drawing object is the life cycle of the drawing.

C. Then it is the status of the state, be sure to know what the state variable is, must be able to enumerate what the state of the situation.

D. Next is the operation.

1. Identify the object of the state diagram

2, Recognition Status: The exam is a combination of state.

3. Conversion Edge:

  Format: Trigger event [guardianship condition]/action

Trigger events: Events that trigger conversions, including calls, trigger signals, time, etc. ( What plans are created in an object or system, and what changes occur )

Guardianship condition (guard): Determines whether the condition can be converted, the condition of guardianship is true to convert

Action: An action that occurs when the transformation is activated ( an event that occurs externally )

√ events are generally written in the passive voice (called triggers, such as onkeypressed, which are written in the passive voice, usually the same as the function name corresponding to the code).

√ If the program explicitly tells you,"if what, how", then must write guard, otherwise to deduct points

√ Action can not write, write wrong to deduct points

√ Be sure to write all the conditions on the wire!

√ The documentation tells you what the status is, be sure to write it out completely

E. The status chart does not have a destination, there must be a starting point !

Answers to questions:

UML Final Review question--2.3:uml state Diagram

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.