Professional Documents
Culture Documents
UNIT II
S.Y. Semester IV
4 Data The route that data takes between the external entities,
flow processes and dataSoftware
stores.
Engineering and Project Management- UNIT II 25
Data-processing models
• Data flow diagrams are used to model the system’s data processing
• These show the processing steps as data flows through a system
• Intrinsic part of many analysis methods
• Simple and intuitive notation that customers can understand
• Show end-to-end processing of data
• Entities must be
connected to a process by
a data flow.
Software Engineering and Project Management- UNIT II 33
DFD rules, guidelines, and tips:
• Data flows cannot cross with each other.
• Data stores cannot be connected to external entities.
Otherwise, it means you’re allowing an external entity access to
your data files and stores.
• The labels of processes can be verb phrases. Data stores are
displayed by nouns.
• Data flows cannot run between two external entities without
going through a process (as you will see in the data flow
diagram examples below).
Software Engineering and Project Management- UNIT II 34
Example 1: Securities Trading Platform
• Level 0 : This Level 0 DFD provides a contextual map of a securities trading
platform. Data flows in one direction from the customer service assistant and the
broker to the platform, and in two directions from customers to the platform and
back again.
Securities Trading
Platform
expanding it to include
account creation by CSA.
3.
Customer then do cash Deposit
withdrawals, deposit, Cash
check transaction, order
placing. It even accounts
for a third-party stock 4.Withdra
exchange center where w Cash
transaction details are
forwarded after an order
is placed. 5. Place
Order
DFD Level 0
• Actions, which are represented by diamond shapes, show how two entities
share information in the database.
• Connecting lines, solid lines that connect attributes to show the relationships
of entities in the diagram.
Programmer
End user Implementation
Logical view s
view & software
managers
Scenarios
Deployment
Process View
View
• process view of a system encompasses the threads and processes that form the
system's concurrency and synchronization mechanisms.
• This view primarily addresses the performance, scalability, and throughput of the
system.
• With the UML, the static and dynamic aspects of this view are captured in the same
kinds of diagrams as for the design view, but with a focus on the active classes that
represent these threads and processes.
Software Engineering and Project Management- UNIT II 61
Implementation View
• The Implementation view/ Development View, which describes the static organization of the
software in its development environment. implementation view of a system encompasses the
components and files that are used to assemble and release the physical system.
• This view primarily addresses the configuration management of the system's releases, made
up of somewhat independent components and files that can be assembled in various ways to
produce a running system.
• With the UML, the static aspects of this view are captured in component diagrams;
• the dynamic aspects of this view are captured in interaction diagrams, statechart diagrams,
and activity diagrams.
Examples:
• System: Aircraft
• Models: Flight simulator, scale model
• Views: All blueprints, electrical wiring, fuel system
Analysis Design
Refactoring Code
Generation
Automated Tests
State machine: State machine is useful when the state of an object in its life
cycle is important. It defines the sequence of states an object goes through
in response to events. Events are external factors responsible for state
change.
name
address
Software Engineering and Project Management- UNIT II 86
Comments
• Comments are used to help clarify the models that are being created
- e.g. comments may be used for explaining the rationale behind some
design decisions
1..
Title * Copy
● Class diagrams
● Object diagrams
● Composite structure diagrams
● Package diagrams
● Component Diagram - Interfaces and Components
● Deployment Diagram
Person
Person
Person
name : String
birthdate : Date
ssn : Id
Person
Person
name eat()
address sleep()
birthdate work()
eat
play play()
• Association
• Generalizations Window <<Interface>
• Dependency + open() : void >
AbstractWindow
Realization
• Realization + close() : void + open() : void
Dependency
Generalizations
Event
Association
Student Instructor
• Here, a Router object requests services from a DNS object by sending messages to
(invoking the operations of) the server.
• The direction of the association indicates that the server has no knowledge of the
Router.
Router DomainNameServer
• The example
Student
indicates that a Student has one or more Instructors:1..* Instructor
The example indicates that every Instructor has one or more Students:
Student Instructor
1..*
⮲ Optional (0 or 1) 0..1
⮲ Exactly one 1 = 1..1
⮲ Zero or more 0..* = *
⮲ One or more 1..*
⮲ A range of values 2..6
Software Engineering and Project Management- UNIT II 99
Association Relationships (Cont’d)
• We can also indicate the behavior of an object in an association (i.e., the role of an object) using
rolenames.
learns from teaches
Student Instructor
1..* 1..*
membership
Student Team
1..* 1..*
member of
1..* 1..*
Student Team
1 president of 1..*
next
LinkedListNode
previous
* 4
Student Course
has enrolls
Class Student {
Course enrolls[4];
}
Class Course {
Student have[];
}
Software Engineering and Project Management- UNIT II 104
Association - Aggregation
• A special form of association that models a whole-part relationship between an
aggregate (the whole) and its parts.
• Aggregation implies a relationship where the child can exist independently of the
parent. Example: Class (parent) and Student (child). Delete the Class and the Students
still exist.
• A hollow diamond is attached to the end of an association path on the side of the
aggregate (the whole) to indicate aggregation.
Eg.
1. An object is physically composed of other objects (e.g. car being physically
composed of an engine and four wheels).
2. An object is a logical collection of other objects (e.g., a family is a collection of
parents and children).
3. An object physically contains other objects (e.g., an airplane physically contains a
pilot). Software Engineering and Project Management- UNIT II 105
Association - Aggregation
Aggregation
⮲ This is the “Has-a” or “Whole/part” relationship
aggregation
Club Member
* *
:Car :Train
0..1 :Person 0..1
0..*
driver 1 passengers
aggregation
Software Engineering and Project Management- UNIT II 106
106
Association - Composition
● Composition
• Strong form of aggregation that implies ownership:
• if the whole is removed from the model, so is the part.
• the whole is responsible for the disposition of its parts
Whole Part
Schedule
Student
Composition
Software Engineering and Project Management- UNIT II 108
Aggregation and Composition
1 :Engine
composition <<part-of>>
:Locomotive 1..*
1 0..1
:Car :Train
0..1 :Person 0..1
0..*
driver 1 passengers
aggregation
<<has>>
has 0..1
School Department
1 1..n 1..n
1..n 1..n
assignedTo
member
-chairperson
n 1..n 1..n 0..1
Person
Student Employee
TeachingAssistant
reflexive association
autoexec
C
config
Command
directories files
Multiplicity exercise
• How many Company
– Employees can a Company have? 1 employer
– Employers can a Person have?
– Owners can a BankAccount have? 7 employee
0..* 0..*
BankAccount
Exercise
• Model a computer file system. Here are
the minimal facts you need:
– The basic unit of storage is the file
– Files live in directories
– Directories can contain other directories
• Use your own knowledge of a specific file
system (e.g. Windows 95 or UNIX) to
build a model
140
Software Engineering and Project Management- UNIT II
Composite Structure Diagram
Part+port+interface
• Two parts are typed with the classifier Wheel and the third is
typed by the classifier Engine. A straight line named Delegate
connector links the internal part named e:Engine to a port
on the external border of the composite structure diagram.
• The external port is typed with the classifier Car and is
named Port:Car. The connector has an open arrowhead that
points toward the external port.
• The two Wheel parts, named front:Wheel[2] and
rear:Wheel[2], are connected by straight lines named
Assembly connectors to the internal port named
Port:Engine.
• A port can interact in both directions and you can add required and
provided interfaces to specify the types of interactions that can occur
between a classifier and its environment.
All interface operations are public and abstract, and do not provide any default
implementation.
• All interface attributes must be constants.
• An interface, when standing alone in a diagram, is either shown as a class element
rectangle with the «interface» keyword and with its name italicized to denote it is
abstract, or it is shown as a circle.
• Finally, Track Order dependency to UI Framework is also mapped which completes our Package Diagram for Order
Processing subsystem. • <<access>> - one package requires help from functions of other package.
• <<import>> - one package imports the functionality of other package,
• A component is a logical unit block of the system, a slightly higher abstraction than
classes.
• Dependencies
Software Engineering
Software Engineering and
andProject
ProjectManagement-
Management-UNIT II II
UNIT 166
Component Views
meetingsDB
:Scheduler reservations
<<direct channel>>
clientMachine:PC
:Planner
• Example: Register Course (standard use case) may have Register for Special
Class (extend use case).
• Standard use case can execute without the extend case i.e. loose coupling
<<include>>
Join
State diagrams are good for modeling the lifetime of an object or actor, also for modeling business processes which
involve many states.
04/10/2024 223
State Machine Diagrams
• Classes can have interesting dynamic behavior - state machines can be used to model this
behaviour
• A state machine models dynamic behavior of a reactive object
• A state machine models the life cycle history of a single reactive object as a finite state machine –
a machine that can exist in finite number of states
• The machine makes transitions between these states in response to events
• 3 key elements:
– State – a condition or situation during life of an object during which it satisfies some condition
, performs some activity or waits for some event
– Event – specification of a noteworthy occurrence that causes transition
– Transition – the movement from one state to another in response to an event
State machine diagrams
light bulb
state = off turnOn
Off On
turnOff
burnOut
light bulb
State = off turnOn
Off On
turnOff
burnOut
Event =
turnOn
light bulb
State = on turnOn
Off On
turnOff
burnOut
light bulb
State = on turnOn
Off On
turnOff
burnOut
Event =
turnOff
light bulb
state = off turnOn
Off On
turnOff
burnOut
transitions acceptPayment
[payment > balance]
• Each outgoing makeRefund
FullyPaid OverPaid PartiallyPaid
transition must
have a mutually
exclusive guard
condition
State Machine Diagram Elements
1. A State
Represents the state of object at an instant of time
Situation during the life of an object in which it satisfies some condition, performs some activity,
or waits for some event.
A state may include:
• Name
• Entry/exit actions
• Internal transitions
• Activities
• Substates
5. Event /Trigger
• Trigger" is the cause of the transition, which could be a signal, an event, a change in some condition, or
the passage of time.
• "Guard" is a condition which must be true in order for the trigger to cause the transition.
• "Effect" is an action which will be invoked directly on the object that owns the state machine as a result
of the transition.
04/10/2024 237
State Machine Diagram
Advanced States
1. Simple state - A state that contains
no substates.
2. Composite state - A state that
contains substates.
3. Substate - A state that is nested
inside another state.
• Substates allow state diagrams to
show different levels of abstraction.
• Substates may be sequential or
concurrent.
• Substates may be nested to any
level.
04/10/2024 238
State Machine Diagram
• Compound States - A state machine diagram may include sub-machine diagrams, as in the
example below.
Alternative way to show the same information
04/10/2024 239
State Machine Diagram
• Choice Pseudo-State - A choice pseudo-state is shown as a diamond with one transition arriving and two
or more transitions leaving.
The following diagram shows that whichever state is arrived at, after the choice pseudo-state, is
dependent on the message format selected during execution of the previous state.
04/10/2024 240
State Machine Diagram
• Junction Pseudo-State - Junction pseudo-states are used to chain together multiple transitions.
A single junction can have one or more incoming, and one or more outgoing, transitions;
a guard can be applied to each transition.
A junction which splits an incoming transition into multiple outgoing transitions realizes a static
conditional branch
04/10/2024 241
State Machine Diagram Elements
• Concurrent Regions - A state may be divided into regions containing substates that exist and execute
concurrently.
• Terminate Pseudo-State - Entering a terminate pseudo-state indicates that the lifeline of the state machine
has ended. A terminate pseudo-state is notated as a cross.
04/10/2024 242
Example to Understand
The state machine diagram shows the states that a door goes through during its lifetime.
• The door can be in one of three states: "Opened", "Closed" or "Locked".
• Notice that not all events are valid in all states;
Example: if a door is opened, you cannot lock it until you close it.
• Also notice that a state transition can have a guard condition attached
Example: if the door is Opened, it can only respond to the Close event if the condition
04/10/2024
doorWay->isEmpty is fulfilled. 243
Example: Stages of a Patient
04/10/2024 244
Example with conditions
04/10/2024 245
Example with conditional transitions
04/10/2024 246
Example with entry/exit actions
04/10/2024 247
Example: Concurrent Regions
04/10/2024 248
Example: Bank ATM
04/10/2024 249
Example: Purchase Order
04/10/2024 250
Example: Drive Vehicle
04/10/2024 251
State Machine Diagrams- Example of Transition of states
253
Software Engineering and Project Management- UNIT II
Advance State Diagram – Example Phone Call
254
Software Engineering and Project Management- UNIT II
State Machine Diagram VS Activity Diagram
• State machines can be used to map out the various states and
transitions within a system.
• Activity diagrams can illustrate how these states and
transitions tie into the overall process flow.
• This complementary use of state machines and activity
diagrams can help visualize complex workflows in different
stages of software development or process design, enabling a
more thorough understanding and control of the system's
behavior.
Software Engineering and Project Management- UNIT II 255
Interaction diagram
• Interaction diagrams
– Sequence Diagram:
• Dynamic behavior of a set of objects
arranged in time sequence, new objects
added to the right
• Good for real-time specifications and
complex scenarios
• Derived from use case scenario
– Collaboration/Communication
Diagram :
• Shows the relationship among objects.
Does not show time
• Objects are arranged in a graph or
network format
Software Engineering and Project Management- UNIT II 256
UML Sequence Diagrams
• Sequence diagrams model the dynamic
aspects of a software system
• The emphasis is on the “sequence” of
messages rather than relationship
between objects
• Sequence diagrams provide more detail
and show the messages exchanged
among a set of objects over time.
• The main purpose of this diagram is to
represent how different business
object interacts
3 Diagram
Boundry
makeNewSale
Simple cash-only Process Sale scenario:
loop [ more items ]
1. Customer arrives at a POS checkout enterItem(itemID, quantity)
with goods and/or services to purchase.
2. Cashier starts a new sale.
3. Cashier enters item identifier. description, total
4. System records sale line item and
presents item description, price, and
running total.
Cashier repeats steps 3-4 until indicates
done. endSale
5. System presents total with taxes
calculated.
6. Cashier tells Customer the total, and total with taxes
asks for payment.
7. Customer pays and System handles
payment. makePayment(amount)
...
Object Lifelines and Object Destruction We may show the explicit destruction of an object .
Interaction Semantics
Operator
alt Alternative fragment for mutual exclusion conditional logic expressed in the
guards. if…then…else
opt Optional fragment that executes if guard is true. switch constructs.
loop Loop fragment while guard is true. loop(n) to indicate looping n times.
region Critical region within which only one thread can run.
par Parallel fragments that execute in parallel. concurrent processing
Break break represents a breaking or exceptional scenario that is performed
Consider consider defines which messages should be considered within this combined
fragment
Ignore Ignore message types can be considered insignificant and are implicitly ignored if
they appear in a corresponding execution.
• Order management
system
30
3
Software Engineering and Project Management- UNIT II
Timing diagram :Value lifeline Representation
• State and Value Lifelines can be put one after the other in any combination.
Messages can be passed from one lifeline to another.
• Each state or value transition can have a defined event, a time constraint
which indicates when an event must occur, and a duration constraint which
indicates how long a state or value must be in effect for.
310
Software Engineering and Project Management- UNIT II
Interaction overview diagram
04/10/2024 312
Communication diagrams
•UML Communication diagrams used to model the dynamic behaviour.
•When compare to Sequence Diagram, the Communication Diagram is more focused on
showing the collaboration of objects rather than the time sequence.
•Components of the communication process include a sender, encoding of a message,
selecting of a channel of communication, receipt of the message by the receiver and
decoding of the message.
•It show the network and sequence of messages or communications between objects at
run-time during a collaboration instance
• Model message passing between objects or roles that deliver the functionalities of
use cases and operations
• Model mechanisms within the architectural design of the system
• Model alternative scenarios within use cases or operations that involve the
collaboration of different objects and interactions
• Support the identification of objects (hence classes), and their attributes
(parameters of message) and operations (messages) that participate in use cases
04/10/2024 314
Communication Diagram Elements
1. Actor
• external to the system
• Participates in the collaboration by sending and/or receiving messages
2. Object
• Instances of a class
• Supplier objects are the objects that supply the method that is being called, and therefore receive
the message.
• Client objects call methods on supplier objects, and therefore send messages.
3.Links
• The connecting lines drawn between objects in a communication diagram are links.
• Each link represents a relationship between objects and symbolizes the ability of objects to send
messages to each other.
• If an object sends messages to itself, the link carrying these messages is represented as a loop icon.
04/10/2024 315
Communication Diagram Elements
4. Messages
Shown as arrows pointing from the Client object to the Supplier object.
Represent a client invoking an operation on a supplier object. They can be modeled along with the
objects in the following manner:
• Message icons have one or more messages associated with them.
• Messages are composed of message text prefixed by a sequence number.
• This sequence number indicates the time-ordering of the message.
• The first message in a communication diagram is always numbered 1, the second is 2, and so on.
• You can indicate that a message is nested under a parent message by adding a decimal point and
incremental digits to the parent's sequence number.
Guard Condition
• Represent a test that must be met for the message to be sent
04/10/2024 316
04/10/2024 317
04/10/2024 318
Communication Diagram at a Glance
• The objects are Object1, Object2, …, ObjectN.
• Messages passed between objects are represented by labeled
arrows that start with the sending object (actor) and end with
the receiving object.
• The sample messages passed between objects are labeled 1:
message1, 2: message2, 3: message3, etc., where the numerical
prefix to the message name indicates its order in the sequence.
• Object1 first sends Object2 the message message1, Object2 in
turn sends ObjectN-1 the message message2, and so on.
• Messages that objects send to themselves are indicated as
loops (e.g., message message5).
• Each message in a communication diagram has a sequence
number.
• Messages sent during the same call have the same decimal
prefix, but suffixes of 1, 2, etc. according to when they occur.
04/10/2024 319
From Sequence Diagram to Communication
Diagram
04/10/2024 320
Example: Scenario (Course Registration )
04/10/2024 321
Example: Scenario (Withdraw Cash from
ATM)
04/10/2024 322
Example: Scenario (Book Doctor’s Appointment)
04/10/2024 323
Example: Scenario(Library Book Overdue)
04/10/2024 324
Example: Scenario(Checkout from a shop)
04/10/2024 325
Process Order Control Communication diagram
• .
Software Engineering and Project Management- UNIT II 329