OOAD Dynamic Modeling - Object Oriented Analysis and Design

What is dynamic modeling in OOAD?

The dynamic model speaks to the time– subordinate parts of a framework. It is worried about the transient changes in the conditions of the items in a framework. The fundamental ideas are
  • State, which is the Scenario at a particular condition during the lifetime of an object.
  • Transition, a change in the state
  • Event, an occurrence that triggers transitions
  • Action, an uninterrupted and atomic computation that occurs due to some event, and
  • Concurrency of transitions.
A state machine models the conduct of a protest as it goes through various states in its lifetime because of a few events and additionally the activities happening because of the events. A state machine is graphically spoken to through a state change chart.

States and State Transitions

State

The state is a deliberation given by the estimations of the properties that the question has at a specific day and age. It is a circumstance happening for a limited day and age in the lifetime of a protest, in which it satisfies certain conditions, plays out specific exercises, or sits tight for specific events to happen. In state change outlines, a state is spoken to by adjusted rectangles.

Parts of a state

  • Name − A string differentiates one state from another. A state may not have any name.
  • Entry/Exit Actions − It denotes the activities performed on entering and on exiting the state.
  • Internal Transitions − The changes within a state that do not cause a change in the state.
  • Sub–states − States within states.

Initial and Final States

The default beginning condition of a question is called its underlying state. The last state demonstrates the fulfillment of execution of the state machine. The underlying and the last states are pseudo-states, and might not have the parts of a customary state aside from name. In state change outlines, the underlying state is spoken to by a filled dark circle. The last state is spoken to by a filled dark hover surrounded internal another unfilled dark circle.

Transition

A progress signifies an adjustment in the condition of a protest. On the off chance that a question is in a specific state when an event happens, the protest may play out specific exercises subject to determined conditions and change the state. For this Scenario, a state−transition is said to have happened. The change gives the connection between the primary state and the new state. A progress is graphically spoken to by a strong guided curve from the source state to the goal state.
The five parts of a transition are −
  • Source State − The state affected by the transition.
  • Event Trigger − The occurrence due to which an object in the source state undergoes a transition if the guard condition is satisfied.
  • Guard Condition − A Boolean expression which if True, causes a transition on receiving the event trigger.
  • Action − An un-interruptible and atomic computation that occurs on the source object due to some event.
  • Target State − The destination state after completion of transition.

Example

Assume a man is assuming a taxi from position X to put Y. The conditions of the individual might be: Waiting (sitting tight for taxi), Riding (he has a taxi and is going in it), and Reached (he has achieved the goal). The accompanying figure portrays the state progress.
transitions

Events

Events are a few events that can trigger state progress of a protest or a gathering of articles. Events have an area in time and space yet don't have an era related with it. Events are by and large connected with a few activities.
Cases of events are mouse click, key press, an interfere with, stack flood, and so on.
Events that trigger advances are composed close by the curve of change in state graphs.

Example

Considering the illustration appeared in the above figure, the progress from Waiting state to Riding state happens when the individual gets a taxi. In like manner, the last state is achieved, when he achieves the goal. These two events can be named as events Get_Taxi and Reach_Destination. The accompanying figure demonstrates the events in a state machine.
transition_events

External and Internal Events

External events are those events that go from a client of the framework to the items internal the framework. For instance, mouse click or key−press by the client are outer events.
Internal events are those that go starting with one protest then onto the next question internal a framework. For instance, stack flood, a partition blunder, and so on.

Deferred Events

Deferred Events are those which are not promptly taken care of by the protest in the present state however are arranged in a line with the goal that they can be dealt with by the question in some other state at a later time.

Event Classes

Event class demonstrates a gathering of events with regular structure and conduct. Likewise with classes of articles, event classes may likewise be sorted out in a various leveled structure. Event classes may have traits related with them, time being an understood property. For instance, we can think about the events of takeoff of a flight of an aircraft, which we can gather into the accompanying class −
Flight_Departs (Flight_No, From_City, To_City, Route)

Actions

Activity

Movement is an operation upon the conditions of a protest that requires some day and age. They are the progressing executions internal a framework that can be intruded. Exercises are appeared in movement charts that depict the spill out of one action to another.

Action

An activity is a nuclear operation that executes because of specific events. By nuclear, it is implied that activities are un-interruptible, i.e., if an activity begins executing, it keeps running into fruition without being hindered by any event. An activity may work upon a question on which an event has been activated or on different articles that are noticeable to this protest. An arrangement of activities contain an action.

Entry and Exit Actions

Passage activity is the activity that is executed on entering a state, independent of the change that drove into it.
In like manner, the activity that is executed while leaving a state, independent of the change that drove out of it, is called a leave activity.

Scenario

Scenario is a depiction of a predefined grouping of activities. It portrays the conduct of articles experiencing a particular activity arrangement. The essential Scenarios delineate the fundamental groupings and the auxiliary Scenarios portray the elective arrangements.

Diagrams for Dynamic Modelling

There are two essential graphs that are utilized for dynamic displaying −

Interaction Diagrams

Communication charts portray the dynamic conduct among various items. It contains an arrangement of articles, their connections, and the message that the items send and get. Hence, a connection models the conduct of a gathering of interrelated articles. The two kinds of connection outlines are −
  • Sequence Diagram − It speaks to the transient requesting of messages in an unthinkable way.
  • Collaboration Diagram − It speaks to the basic association of articles that send and get messages through vertices and circular segments.

State Transition Diagram

State change graphs or state machines depict the dynamic conduct of a solitary question. It shows the successions of states that a protest experiences in its lifetime, the changes of the states, the events and conditions causing the progress and the reactions because of the events.

Concurrency of Events

In a framework, two sorts of Concurrency may exist. They are −

System Concurrency

Here, Concurrency is demonstrated in the framework level. The general framework is demonstrated as the collection of state machines, where each state machine executes simultaneously with others.

Concurrency within an Object

Here, a protest can issue simultaneous events. A protest may have states that are made out of sub-states, and simultaneous events may happen in each of the sub-states.
Ideas identified with Concurrency internal a protest are as per the following −

Simple and Composite States

A basic state has no sub-structure. An express that has more straightforward states settled internal it is known as a composite state. A sub-state is an express that is settled internal another state. It is by and large used to lessen the many-sided quality of a state machine. Sub-states can be settled to any number of levels.
Composite states may have either successive sub-states or simultaneous sub-states.

Sequential Sub-states

In successive sub-expresses, the control of execution goes starting with one sub-state then onto the next sub-state consistently in a consecutive way. There is at most one beginning state and one last state in these state machines.
The accompanying figure represents the idea of successive sub-states.
sequential_sub_states

Concurrent Sub-states

In Concurrent Sub-states, the sub-states execute in parallel, or as such, each state has simultaneously executing state machines internal it. Each of the state machines has its own particular beginning and last states. In the event that one simultaneous sub-state achieves its last state before the other, control holds up at its last state. At the point when all the settled state machines achieve their last expresses, the sub-states join back to a solitary stream.
The accompanying figure demonstrates the idea of simultaneous sub-states.
concurrent_sub_states

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Object Oriented Analysis and Design Topics