Sunday, October 12, 2014

Explain object behaviour model.




ANSWER:
States
A state represents the status, phase, situation, or activity of an object. It is represented by a rectangle with rounded corners, with the name of the state written inside. A state can be on or off, active or inactive, etc. A state can only be turned on or off by transition, unless an exception occurs.
Transitions
A transition is the process of changing the state of an object. It is represented by a rectangle divided into two sections. The top section contains the trigger, which is the event or condition that activates the transition. The bottom section contains the action, which may cause events, create, destroy, and observe objects and relationships, and send and receive messages.
Initial transitions activate initial states, which are the states exhibited by an object when it comes into existence in a system. They have no prior states and are always enabled.
Final transitions are transitions with no subsequent states. When a final transition fires, the prior states of the final transition are turned off.
Exceptions
An exception is an event or condition that is not part of normal system behaviour. A state exception is represented in the state-net by a bar across a transition arrow. A transition exception is represented by an arrow from the transition in which the exception may occur to a state that the object enters following the exception.
Threads
An object can be in more than one state at the same time. In other words, there can be multiple threads of execution in an object. Real-time constraints
Real-time constraints may be added to a state net when time is an important element of object behaviour. Real-time constraints can applied to triggers, actions, states, and state-transition paths. We use braces, { }, to specify real-time constraints. The braces can be put in the transition rectangle, near the state and on the state-transition path.
High-level states
A high-level state is a state in which the activity performed is defined by another state net. We may define high-level states bottom-up by creating high-level states from low-level states and transitions. We may also define high-level states top-down by providing a state net for an existing state.
High-level transition
A high-level transition is a transition in which the activity performed is defined by another state net. As for high-level states, we may create high-level transitions either top-down or bottom-up. For top-down creation, a state net is supplied which describes the behavior of a high-level transition. For bottom-up creation, a high-level transition is created by specifying which existing state-net components belong to the new transition.
Generalization/Specialization
Abstraction and inheritance are powerful tools. In order to represent common behaviours commonly, object sets inherit all behaviours which their generalization object set have. Specialization object sets may add addition states or transitions and modify or delete inherited ones.

No comments: