Software Engineering
Interaction Model
This interaction model shows the user interaction, which involves user input and
output interaction between the system being developed and other systems, or
interaction between the components of the system. Modelling user interaction is
important, as it helps to identify user requirements, and highlights the
communication problems that may arise.
Interaction modelling is further classified into two types :
1. Use case diagram.
2. Sequence diagram.
Use case modelling:
This is mostly used to model the interaction between a system and an external
actor.
1. Use case diagrams are visual representations that depict the interaction
between an actor and a system. They show various use cases of
functionality that the system provides.
2. The components of the use case diagram are:
1. Actor: represents an external entity interacting with the system.
2. Use case: Represent specific functionality or task the system
performs.
3. Relationship: Shows connection. Between actor and use case.
3. An association colony is represented by a line connecting an actor to a use
case. It signifies the communication or Interaction between the actor and
the use case.
1. Included relationship: It signifies that a use case includes the
functionality of another use case, providing a modular and
irreducible design.
2. Extended relationship : It determines that a use case be extended
by another use case under specific conditions.
Software Engineering
Use Case Diagram: Patient & Medical Receptionist
👤 Actors:
Patient (wants medical services)
Medical Receptionist (handles admin tasks)
Use Cases:
For Patient:
Register
Book Appointment
View Appointment
Cancel Appointment
Make Payment
For Medical Receptionist:
Register Patient
Schedule Appointment
Cancel Appointment
Update Patient Record
Generate Invoice
Software Engineering
Relationships
Patient interacts with self-service features (appointments, payments).
Receptionist handles administrative tasks on behalf of the patient.
2. Sequence diagram:-
A sequence diagram is a type of interaction diagram in software engineering that
illustrates the interactions between objects or components within a system over
time. It depicts the flow of messages or calls between these objects, showing the
order in which they occur. It visually represents the interaction and order of
messages between different objects or components within a system over some
time.
Here's a detailed description of the components and usage of a sequence
diagram:
1. Objects (Lifelines):
Objects, also known as lifelines, represent instances of classes,
components, or entities within the system.
Each object is depicted as a vertical line (lifeline) on the diagram.
Objects are labelled with their names or identifiers.
Lifelines represent the lifespan of an object during the sequence of
interactions.
2. Messages:
Messages are depicted as horizontal arrows between lifelines,
representing communication or interactions between objects.
Messages can be synchronous or asynchronous:
Synchronous messages indicate that the sender waits for a
response from the receiver before proceeding.
Asynchronous messages indicate that the sender continues
execution without waiting for a response.
Software Engineering
Messages may also include parameters or return values, which are
shown along with the arrow.
3. Activation Bar:
An activation bar is a vertical dashed line drawn on the lifeline to
represent the period during which an object is performing an
operation.
It shows when an object is active and processing a message.
The length of the activation bar indicates the duration of the
object's activity.
4. Return Messages:
Return messages are depicted as arrows with a dashed line
indicating the return path from the calling object back to the calling
object.
They represent the flow of control back to the caller after the called
operation is completed.
Unified Modeling Language (UML) Diagrams
Unified Modeling Language (UML) is a general-purpose modeling language. The
main aim of UML is to define a standard way to visualize the way a system has
been designed. It is quite similar to blueprints used in other fields of
engineering. UML is not a programming language, it is rather a visual language.
Types of UML Diagrams
UML is linked with object-oriented design and analysis. UML makes use of
elements and forms associations between them to form diagrams. Diagrams in
UML can be broadly classified as:
Software Engineering
1. Structural UML Diagrams
Structural UML diagrams are visual representations that depict the static
aspects of a system, including its classes, objects, components, and their
relationships, providing a clear view of the system's architecture. Structural
UML diagrams include the following types:
Class Diagram
The most widely use UML diagram is the class diagram. It is the building block
of all object oriented software systems. We use class diagrams to depict the
static structure of a system by showing system's classes, their methods and
attributes. Class diagrams also help us identify relationship between different
classes or objects.
Object Diagram
An Object Diagram can be referred to as a screenshot of the instances in a
system and the relationship that exists between them. Since object diagrams
depict behaviour when objects have been instantiated, we are able to study
the behaviour of the system at a particular instant.
An object diagram is similar to a class diagram except it shows the
instances of classes in the system.
We depict actual classifiers and their relationships making the use of
class diagrams.On the other hand, an Object Diagram represents specific
instances of classes and relationships between them at a point of time.
Component Diagram
Component diagrams are used to represent how the physical components in a
system have been organized. We use them for modelling implementation
details.
Component Diagrams depict the structural relationship between
software system elements and help us in understanding if functional
requirements have been covered by planned development.
Software Engineering
Component Diagrams become essential to use when we design and build
complex systems.
Interfaces are used by components of the system to communicate with
each other.
Package Diagram
We use Package Diagrams to depict how packages and their elements have
been organized. A package diagram simply shows us the dependencies
between different packages and internal composition of packages.
Packages help us to organise UML diagrams into meaningful groups and
make the diagram easy to understand.
They are primarily used to organise class and use case diagrams.
Behavioral UML Diagrams
Behavioral UML diagrams are visual representations that depict the dynamic
aspects of a system, illustrating how objects interact and behave over time in
response to events.
State Machine Diagrams
A state diagram is used to represent the condition of the system or part of the
system at finite instances of time. It’s a behavioral diagram and it represents
the behavior using finite state transitions.
State diagrams are also referred to as State machines and State-chart
Diagrams
Activity Diagrams
We use Activity Diagrams to illustrate the flow of control in a system. We can
also use an activity diagram to refer to the steps involved in the execution of a
use case.
We model sequential and concurrent activities using activity diagrams.
So, we basically depict workflows visually using an activity diagram.
Software Engineering
An activity diagram focuses on condition of flow and the sequence in
which it happens.
We describe or depict what causes a particular event using an activity
diagram.
Use Case Diagrams
Use Case Diagrams are used to depict the functionality of a system or a part of
a system. They are widely used to illustrate the functional requirements of the
system and its interaction with external agents(actors).
A use case is basically a diagram representing different scenarios where
the system can be used.
A use case diagram gives us a high level view of what the system or a
part of the system does without going into implementation details.