�UNIT-4
Behavioural Modelling:
�UNIT-4
Architectural Modelling:
Behavioural Modelling
Interactions:
Purpose of Interaction Diagrams
�Behavioural Modelling
Use of an Interaction Diagram
How to Draw an Interaction Diagram?
The purpose of interaction diagrams is to capture the dynamic aspect of a system. So to capture the dynamic aspect, we need to understand what a dynamic aspect is and how it is visualized. Dynamic aspect can be defined as the snapshot of the running system at a particular moment
Following things are to be identified clearly before drawing the interaction diagram
sequence diagram of ORDER MANAGEMENT SYSTEM
collaboration diagram
Where to use Intraction Diagrams:
Interaction diagrams can be used −
Sequence Diagrams | Collaboration Diagrams |
The sequence diagram are used to represent the sequence of messages that are flowing from one object to another. | The collaboration diagram are used to represent the structural organization of the system and the messages that are sent and received. |
The sequence diagram is used when time sequence is main focus. | The collaboration diagram is used when object organization is main focus. |
The sequence diagrams are better suited of analysis activities. | The collaboration diagrams are better suited for depicting simpler interactions of the smaller number of objects. |
Behavioural Modelling
�Behavioural Modelling
Use Case Diagrams :
A use case diagram is used to represent the dynamic behaviour of a system. It encapsulates the system's functionality by incorporating use cases, actors, and their relationships.
Purpose of Use Case Diagrams
�Behavioural Modelling
How to draw a Use Case diagram
�Example of Use case Diagram
Both View Recommended Item and Add to Wish List include the Customer Authentication use case, as they necessitate authenticated customers, and simultaneously item can be added to the shopping cart without any user authentication.
�Example of Use case Diagram
The Checkout use case also includes the following use cases, as shown below. It requires an authenticated Web Customer, which can be done by login page, user authentication cookie ("Remember me"), or Single Sign-On (SSO). SSO needs an external identity provider's participation, while Web site authentication service is utilized in all these use cases..
�Use Case Diagram
some important tips that are to be kept in mind while drawing a use case diagram:
�Activity Diagrams
The activity diagram is used to demonstrate the flow of control within the system rather than the implementation.
It is also termed as an object-oriented flowchart. It encompasses activities composed of a set of actions or operations that are applied to model the behavioural diagram.
Components of an Activity Diagram
Activities
The categorization of behaviour into one or more actions is termed as an activity.
�Activity Diagrams
Swim lane: The swim lane is used to cluster all the related activities in one column or one row. It can be either vertical or horizontal. It used to add modularity to the activity diagram.
Forks: Forks and join nodes generate the concurrent flow inside the activity. A fork node consists of one inward edge and several outward edges.
Join Nodes: Join nodes are the opposite of fork nodes. A Logical AND operation is performed on all of the inward edges as it synchronizes the flow of input across one single output (outward) edge.
�Activity Diagrams
Notation of an Activity diagram
Initial State: It depicts the initial stage or beginning of the set of actions.
Final State: It is the stage where all the control flows and object flows end.
Decision Box: It makes sure that the control flow or object flow will follow only one path.
Action Box: It represents the set of actions that are to be performed
�Activity Diagrams
Example of an Activity Diagram:
An activity diagram showing the business flow activity of order processing.
An activity diagram can be used to portray business processes and workflows.
�Events and Signals
Events and Signals: These are use in state chart diagram.
�Events and Signals
Events
Call Event :
Signals
�State Machines
State machines :
Notation of a State Machine Diagram
Initial state: It defines the initial state (beginning) of a system, and it is represented by a black filled circle.
Final state: It represents the final state (end) of a system. It is denoted by a filled circle present within a circle.
Decision box: It is of diamond shape that represents the decisions to be made on the basis of an evaluated guard.
State box: It depicts the conditions or circumstances of a particular object of a class at a specific point of time.
A rectangle with round corners is used to represent the state box.
�Events and Signals
state machine
It may be sent as the action of a state transition in a state machine or the sending of a message in an interaction
Signals are modelled as stereotyped classes and the relationship between an operation and the events by using a dependency relationship, stereotyped as send.
�Events and Signals
Sending and Receiving Events
For Synchronous Events:
For Asynchronous Events:
�Events and Signals
Signals and Active Classes
�State Machines
State machines :
The state machine diagram is also called the State chart or State Transition diagram, underwent by an object within the system which shows the order of states
It captures the software system's behaviour. It models the behaviour of a class, a subsystem, a package, and a complete system.
Following are the types of a state machine diagram
1. Behavioural state machine�The behavioural state machine diagram records the behaviour of an object within the system. It depicts an implementation of a particular entity. It models the behaviour of the system.
2. Protocol state machine�It captures the behaviour of the protocol. The protocol state machine depicts the change in the state of the protocol and parallel changes within the system. But it does not portray the implementation of a particular component.
�State Machines
Following are the steps while drawing a state machine diagram:
State machine diagram is used for:
�State Machines
Example of a State Machine Diagram
�State Machines
State Machine Vs Flow Chart
�Processes and Threads
Processes and Threads :
Processes
A process is an active program i.e. a program that is under execution. A process is a heavyweight flow that can execute concurrently with other processes.
NEW: A new process is being created.
READY: A process is ready and waiting to be allocated to a processor.
RUNNING: The program is being executed.
WAITING: Waiting for some event to happen or occur.
TERMINATED: Execution finished.
�Processes and Threads
Threads :
A thread is the subset of a process and is also known as the lightweight process. A process can have more than one thread, and these threads are managed independently by the scheduler.
�Processes and Threads
Processes and Threads :
Types of Threads
There are two types of threads, which are:
1. User Level Thread
As the name suggests, the user-level threads are only managed by users, and the kernel does not have its information.
These are faster, easy to create and manage.
2. Kernel-Level Thread
The kernel-level threads are handled by the Operating system and managed by its kernel. These threads are slower than user-level threads because context information is managed by the kernel. To create and implement a kernel-level thread, we need to make a system call.
Architectural Modelling: ��Component�Deployment�Component diagrams �Deployment diagrams
Component Diagram
Benefits
Component diagram notations
Example of a Component Diagram��online shopping:
Deployment diagrams
The deployment diagram visualizes the physical hardware on which the software will be deployed.
Purpose of Deployment Diagram
Symbol and notation of Deployment diagram�
Deployment diagram of ATM
Role during the administrative process, it involves the following parameters:
END OF UNIT-IV
Thank
you
Department of Information Technology
49