Tuesday, July 4, 2017

Behavioral Modeling | Identifying Events with the Use Case | State Representations | State diagram | The States of a System | Sequence diagram | Sequence diagram | Points to remember when creating these diagrams

Behavioral Modeling
·         Introduction: Flow Oriented Model represents static elements of the requirements model.
·         It is now time to make a transition to the dynamic behavior of the system or product. To accomplish this, you can represent the behavior of the system as a function of specific events and time.
·         The behavioral model indicates how software will respond to external events.
·         To create the model, the analyst must perform the following steps.
o   Evaluate all use-cases to fully understand the sequence of interaction within the system.
o   Identify events that drive the interaction sequence and understand how these events relate to specific objects.
o   Create a sequencefor each use-case
o   Builda state diagram for the system


o   Reviewthe behavioralmodel to verify accuracy and consistency.


Identifying Events with the Use Case

·         The use case represents a sequence of activities that involves actors and the system.
·         In general, an event occurs whenever the system and an actor exchange information.
·         It has been indicated that an event is not the information that has been exchanged, but rather the fact that information has been exchanged.
·         For example : The use case for a portion of the SafeHome security function.
·         The homeowner uses the keypad to key in a four-digit password. The password is compared with the valid password stored in the system. If the password is incorrect, the control panel will beep once and reset itself for additional input. If the password is correct, the control panel awaits further act.
·         The underlined portions of the use case scenario indicate events. An actor should be identified for each event; the information that is exchanged should be noted,.


·         Here the object, Homeowner, transmits an event to the object ControlPanel. The event might be called password entered.

Identifying Events with the Use Case

State Representations

·         In the context of behavioral modeling, two different characterizations of states must be considered:
o   The state of each class as the system performs its function and
o   The state of the system as observed from the outside as the system performs its function.

·         The state of a class takes on both passive and active characteristics.

o   A passive state is simply the current status of all of an object’s attributes.
o   The active state of an object indicates the current status of the object as it undergoes a continuing processing.

·         For example, the passive state of the class Player (in the video game application) would include the current position and orientation attributes of Player as well as other features of Player that are relevant to the game .

·         The class Player might have the following active states:

o   Moving, at rest, injured, being cured;, lost etc.

·         An event (sometimes called a trigger) must occur to force an object to make a transition from one active state to another.

State diagram


State diagram

·         One component of a behavioral model is a UML state diagram that represents active states for each class and the events (triggers) that cause changes between these active states.
·         Figure  (In  Previous  Slide)  illustrates  a  state  diagram  for  the ControlPanel object in the Safe Home security function.
·         Each arrow shown in Figure represents a transition from one active state of an object to another. The labels shown for each arrow represent the event that triggers the transition.
·         An action occurs concurrently with the state transition, generally involves one or more operations (responsibilities) of the object.
·         For example, the action connected to the password entered event (ing Figure) is an operation named validatePassword() that accesses a password object and performs a digit-by-digit comparison to validate the entered password.

The States of a System

·         state—a set of observable circum-stances that characterizes the behavior of a system at a given time.
·         state transition—the movement from one state to another.
·         event—an occurrence that causes the system to exhibit some predictable form of behavior.
·         action—process that occurs as a consequence of making a transition.
·         state—a set of observable circum-stances that characterizes the behavior of a system at a given time.
·         state transition—the movement from one state to another.

Sequence diagram

·         The second type of behavioral representation, called a sequence diagram in UML, indicates how events cause transitions from object to object.
·         Once events have been identified by examining a use case, the modeler creates a sequence diagram.
o   It is a representation of how events cause flow from one object to another as a function of time.
o   The sequence diagram is a shorthand version of the use case. It represents key classes and the events that cause behavior to flow from class to class.
·         For example: Figure (In Next Slide) illustrates a partial sequence diagram for the SafeHome security function.
o   Each of the arrows represents an event (derived from a use case)
o   It indicates how the event channels behavior between SafeHome objects.
o   Time is measured vertically (downward),
o   Narrow vertical rectangles represent time spent in processing an activity.
Sequence diagram

Sequence diagram

·         Explanation of Figure: The first event, system ready, is derived from the external environment and channels behavior to the Homeowner object.
·         The homeowner enters a password. A request lookup event is passed to System, which looks up the password in a simple database and returns a result (found or not found) to ControlPanel (now in the comparing state).
A valid password results in a password=correct event to System, which activates Sensors with a request activation event. Ultimately, control is passed back to the homeowner with the activation successful event.

Points to remember when creating these diagrams

State diagram
·         It shows the object undergoing a process.
·         It gives a clear picture of the changes in the object's state in this process.
·         For example ATM withdraw Card
·         object state: Checking, Approving, Rejecting.

·         Sequence diagrams is that,it   is   a good at   showing

sequential logic but not that

good at giving you a "big picture

view “.


No comments:

Post a Comment

Follow by Email