Software
Software
Dr.D.KAVITHA
SCOPE
VIT, CHENNAI
Non-Functional Requirements are classified into many types. Some of Domain Requirements
them are as:
• Domain requirements are the requirements related to a particular
• Interface Constraints category like software, purpose or industry, or other domain of
• Economic Constraints projects. Domain requirements can be functional or non-functional.
• Operating Constraints These are essential functions that a system of specific domains must
necessarily exhibit.
• Performance constraints: storage space, response time, security, etc.
• The common factor for domain requirements is that they meet
• Life Cycle constraints: portability, maintainability, etc. established standards or widely accepted feature sets for that
category of the software project. Domain requirements typically arise
in military, medical, and financial industry sectors. They are identified
from that specific domain and are not user-specific.
• Difference between Functional Requirement and Non-Functional
Examples of domain requirements are- medical equipment or
Requirement
educational software.
Software in medical equipment Functional Requirement Non-Functional Requirement
• In medical equipment, software must be developed per IEC 60601 It is used for defining a system and its components.
It is used for defining the quality attribute of a
software system.
regarding medical electrical equipment's basic safety and
performance. It focuses on what software will be doing.
It fixes the constraint on which software should fulfill
the functional requirement.
• The software can be functional and usable but not acceptable for The user specifies it.
Techies like architects or software developers specify
production because it fails to meet domain requirements. it.
It is compulsory. It is not compulsory.
An Academic Software It is easy to define. It is comparatively tough to define.
• Such software must be developed to maintain records of an institute It verifies the functionality of the system. It verifies the performance of the system.
efficiently. It is defined as a system at the component level. It is defined as a system as a whole.
• Domain requirement of such software is the functionality of being Example-System should be shut down if a cyber attack Example-Within 10 seconds, the processing should be
happens. done of each request.
able to access the list of faculty and list of students of each grade.
System Modeling
• System modeling is the process of developing abstract models of a system, UML Diagram Types
with each model presenting a different view or perspective of that system.
• most models use some kind of graphical notation representing a system, The System Perspectives (last slide) are modeled with diagrams
which is known as Unified Modeling Language (UML) Activity diagrams, which show the activities involved in a process or
Benefits of System Modeling in data processing .
1. Ease project management tasks. Use case diagrams, which show the interactions between a system
and its environment.
2. Can provide complete views of a system, as well as detailed views of
subsystems. Sequence diagrams, which show interactions between actors and
the system and between system components.
3. Clarify structures and relationships. Class diagrams, which show the object classes in the system and the
4. Offer a communication framework for ideas within and between teams. associations between these classes.
Can generate new ideas and possibilities. State diagrams, which show how the system reacts to internal and
5. Allow quality assurance and testing scenarios to be generated. external events.
6. Platform independent.
1. Context models
Context models are used to illustrate the operational context of a
2. Interaction models system -
3. Structural models They show what lies outside the system boundaries.
4. Behavioral models
Social and organizational concerns may affect the decision on
5. Model-driven engineering where to position system boundaries.
Context models simply show the other systems in the environment, not
how the system being developed is used in that environment.
Modeling user interaction is used to identify user Use cases were developed originally to support requirements
elicitation and now incorporated into the UML.
requirements.
We see structural connections and dynamic Each use case represents a discrete task that involves external
(behavioral) interactions. interaction with a system.
We do this with graphical models.
Actors in a use case may be people, devices, or other systems.
Use case diagrams and sequence diagrams may be Represented diagramatically to provide an overview of the use case
used for interaction modeling. and in a more detailed textual form.
These are the most popular modeling mechanisms
A use case in the MHC-PMS Actors Medical receptionist, patient records system (PRS)
Description A receptionist may transfer data from the MHC-PMS to a general patient record database that is maintained
by a health authority. The information transferred may either be updated personal information (address,
phone number, etc.) or a summary of the patient’s diagnosis and treatment.
Data Patient’s personal information, treatment summary
Comments The receptionist must have appropriate security permissions to access the patient information and the PRS.
Sequence diagrams are part of the UML and are used to model the
interactions between the actors and the objects within a system.
The objects and actors involved are listed along the top of the
diagram, with a dotted line drawn vertically from these.
Key points
Requirements Specification and Requirement Validation
• For requirement specification write(SRS)
A model is an abstract view of a system that ignores system details.
Complementary system models can be developed to show the system’s Once the SRS completed validation begins
context, interactions, structure and behavior.
Requirement Validation
Context models show how a system that is being modeled is positioned in • The development of software begins once the requirements
an environment with other systems and processes.
document is ‘ready’
Use case diagrams and sequence diagrams are used to describe the • Ensure that the requirements specification (SRS)contains no
interactions between users and systems in the system being designed. Use errors and that it specifies the user’s requirements correctly.
cases describe interactions between a system and external actors;
sequence diagrams add more information to these by showing interactions • If errors present in the SRS will adversely affect the cost if they
between system objects.
are detected later in the development process or when the
software is delivered to the user.
• In the validation phase the requirements are examined for • The requirements document should be formulated and organized according to the standards of the organization.
• The organizational standards are specified standards followed by the organization according to which the
consistency, omissions, and ambiguity. system is to be developed.
• The basic objective is to ensure that the SRS reflects the actual
requirements accurately and clearly.
• objectives of the requirements document are given below.
1. To certify that the SRS contains an acceptable description of the system to be implemented
2. To ensure that the actual requirements of the system are reflected in the SRS
3. To check the requirements document for completeness, accuracy, consistency, requirement conflict‘,
The agreed actions is a list that displays the actions to be performed to resolve the problems
conformance to standards and technical errors.
depicted in the problem list.
• Requirements validation studies the ‘final draft’ of the
requirements document while requirements analysis studies the
‘raw requirements’ from the system stakeholders (users).
• Quality Assurance
• Companies should be able to trace each requirement back to its • Getting requirements right the first time means better quality, faster development cycles and
original business objective throughout the development process, not higher customer satisfaction with the product. Concise, specific requirements can help companies
merely after it’s complete. By tracing requirements, companies can detect and solve problems earlier rather than later, when they are much more expensive to fix.
identify the ripple effect changes have, see if they have completed a • Research has shown that project teams can eliminate 50 percent to 80 percent of project defects
requirement and if they tested it properly. With traceability, and by by effectively managing requirements. In addition, according to Borland Software (now Micro
Focus), it can cost up to 100 times more to correct a defect later in the development process,
managing changes effectively, managers gain the visibility to after it’s been coded, than when it’s still in written form.
anticipate issues and ensure continuous quality. • By integrating requirements management best practices into their quality assurance process,
• Traceability also makes sure the product meets all the vital companies can help teams increase efficiency and eliminate rework. According to the Carnegie
requirements that come from different stakeholders. By tracing Mellon Software Engineering Institute, 60 to 80 percent of the cost of software development is in
rework. In other words, development teams are wasting the majority of their budgets on efforts
requirements, all team members stay connected to each other and they didn’t perform correctly the first time.
to all interdependencies. And by managing changes well, a company • Requirements management best practices can appear to be a complex topic, but at its core, it’s a
can avoid scope creep — unplanned changes that occur when simple concept. It helps teams answer the question: Does everyone — from business leaders to
requirements are not clearly captured, understood and product managers and project leaders to developers, QA managers and testers — understand
communicated. The benefit of good requirements is a clear what is being built and why?
understanding of the product and the scope involved. This leads to a • When everyone is collaborating and has full context and visibility into the discussions, decisions
better development schedule and budget, which prevents delays and and changes involved in product development, they maintain high quality and almost always
ensure success.
cost overruns.
Software Design
BCSE301L SOFTWARE Design concepts and principles - Abstraction - Refinement - Modularity
Cohesion coupling, Architectural design, Detailed Design Transaction
ENGINEERING Transformation, Refactoring of designs, Object oriented Design User-
Interface Design
Dr.D.KAVITHA
SCOPE
VIT, CHENNAI
Strategy of Design • 1. Top-down Approach: This approach starts with the identification of
• A good system design strategy is to organize the program modules in the main components and then decomposing them into their more
such a method that are easy to develop and to change. Structured detailed sub-components.
design methods help developers to deal with the size and complexity
of programs. Analysts generate instructions for the developers about
how code should be composed and how pieces of code should fit
together to form a program.
• To design a system, there are two possible approaches:
1.Top-down Approach
2.Bottom-up Approach
Coupling and Cohesion
2. Bottom-up Approach: A bottom-up approach begins with the lower • Module Coupling
details and moves towards up the hierarchy, as shown in fig. This • In software engineering, the coupling is the degree of interdependence between
approach is suitable in case of an existing system. software modules. Two modules that are tightly coupled are strongly dependent
on each other. However, two modules that are loosely coupled are not dependent
on each other. Uncoupled modules have no interdependence at all within them.
The various types of coupling techniques are shown in fig
• A good design is the one that has low coupling. Coupling is measured 1. No Direct Coupling: There is no direct coupling between M1 and M2.
by the number of relations between the modules. That is, the
coupling increases as the number of calls between modules increase
or the amount of shared data is large. Thus, it can be said that a
design with high coupling will have more errors.
In this case, modules are subordinates to different modules. Therefore, no direct coupling.
2. Data Coupling: When data of one module is passed to another module, this is called data coupling.
• 3.Stamp Coupling: Two modules are stamp coupled if they communicate using
composite data items such as structure, objects, etc. When the module passes
non-global data structure or entire structure to another module, they are said to
be stamp coupled. For example, passing structure variable in C or object in C++
language to a module.
• 4. Control Coupling: Control Coupling exists among two modules if data from one
module is used to direct the structure of instruction execution in another.
7. Content Coupling: Content Coupling exists among two modules if they share code, e.g., a branch
• 5. External Coupling: External Coupling arises when two modules share an from one module into another module.
externally imposed data format, communication protocols, or device interface.
This is related to communication to external tools and devices. Module Cohesion
In computer programming, cohesion defines to the degree to which the
• 6. Common Coupling: Two modules are common coupled if they share elements of a module belong together. Thus, cohesion measures the strength of
information through some global data items. relationships between pieces of functionality within a given module. For
example, in highly cohesive systems, functionality is strongly related.
Types of Modules Cohesion 1. Functional Cohesion: Functional Cohesion is said to exist if the different elements of a module, cooperate to
achieve a single function.
example of functional cohesion includes reading transaction records because all the elements related to single
transaction are involved in it.
2. Sequential Cohesion: A module is said to possess sequential cohesion if the element of a module form the
components of the sequence, where the output from one component of the sequence is input to the next.
3.Communicational Cohesion: A module is said to have communicational cohesion, if all tasks of the module
refer to or update the same data structure, e.g., the set of functions defined on an array or a stack.
4.Procedural Cohesion: A module is said to be procedural cohesion if the set of purpose of the module are all
parts of a procedure in which particular sequence of steps has to be carried out for achieving a goal, e.g., the
algorithm for decoding a message.
5.Temporal Cohesion: When a module includes functions that are associated by the fact that all the methods
must be executed in the same time, the module is said to exhibit temporal cohesion.
6.Logical Cohesion: A module is said to be logically cohesive if all the elements of the module perform a similar
operation. For example Error handling, data input and data output, etc.
7.Coincidental Cohesion: A module is said to have coincidental cohesion if it performs a set of tasks that are
associated with each other very loosely.
Software Architecture Design
• Differentiate between Coupling and Cohesion
• The architecture of a system describes its major components,
Coupling Cohesion their relationships (structures), and how they interact with each
Coupling is also called Inter-Module Binding. Cohesion is also called Intra-Module Binding. other.
Coupling shows the relationships between modules. Cohesion shows the relationship within the module. • Software architecture and design includes several contributory
factors such as Business strategy, quality attributes, human
dynamics, design, and IT environment.
Coupling shows the relative independence between the Cohesion shows the module's relative functional strength.
modules.
While creating, you should aim for low coupling, i.e., While creating you should aim for high cohesion, i.e., a
dependency among modules should be less. cohesive component/ module focuses on a single function
(i.e., single-mindedness) with little interaction with other
modules of the system.
In coupling, modules are linked to the other modules. In cohesion, the module focuses on a single thing.
• Software Architecture and Design divided into two distinct • Further, it involves a set of significant decisions about the
phases: Software Architecture and Software Design. organization related to software development and each of
• In Architecture, nonfunctional decisions are cast and separated these decisions can have a considerable impact on quality,
by the functional requirements. In Design, functional maintainability, performance, and the overall success of the
requirements are accomplished. final product. These decisions comprise of −
Software Architecture • Selection of structural elements and their interfaces by which the
Architecture serves as a blueprint for a system. It provides an system is composed.
abstraction to manage the system complexity and establish a • Behavior as specified in collaborations among those elements.
communication and coordination mechanism among • Composition of these structural and behavioral elements into large
components. subsystem.
It defines a structured solution to meet all the technical and • Architectural decisions align with business objectives.
operational requirements, while optimizing the common quality • Architectural styles guide the organization.
attributes like performance and security.
Software Design
• Software design provides a design plan that describes the
elements of a system, how they fit, and work together to fulfill
the requirement of the system. The objectives of having a
design plan are as follows −
• To negotiate system requirements, and to set expectations
with customers, marketing, and management personnel.
• Act as a blueprint during the development process.
• Guide the implementation tasks, including detailed design,
coding, integration, and testing.
• It comes before the detailed design, coding, integration, and
testing and after the domain analysis, requirements analysis,
and risk analysis.
Architectural Style
• The architectural style, also called as architectural
pattern, is a set of principles which shapes an application. • The software that is built for computer-based systems exhibit one
It defines an abstract framework for a family of system in of many architectural styles. Each style describes a system category
terms of the pattern of structural organization. that encompasses −
The architectural style is responsible to − • A set of component types which perform a required function by the
system.
• Provide a lexicon of components and connectors with rules • A set of connectors (subroutine call, remote procedure call, data
on how they can be combined. stream, and socket) that enable communication, coordination, and
• Improve partitioning and allow the reuse of design by cooperation among different components.
giving solutions to frequently occurring problems. • Semantic constraints which define how components can be
integrated to form the system.
• Describe a particular way to configure a collection of • A topological layout of the components indicating their runtime
components (a module with well-defined interfaces, interrelationships.
reusable, and replaceable) and connectors (communication
link between modules).
Types of Architecture
• There are four types of architecture from the viewpoint of an • Information architecture − Defines the logical and physical data
enterprise and collectively, these architectures are referred to assets and data management resources.
as enterprise architecture. • Information technology (IT) architecture − Defines the hardware
• Business architecture − Defines the strategy of business, and software building blocks that make up the overall information
governance, organization, and key business processes within system of the organization.
an enterprise and focuses on the analysis and design of Architecture Design Process
business processes. • The architecture design process focuses on the decomposition of a
system into different components and their interactions to satisfy
• Application (software) architecture − Serves as the blueprint functional and nonfunctional requirements. The key inputs to
for individual application systems, their interactions, and their software architecture design are −
relationships to the business processes of the organization. • The requirements produced by the analysis tasks.
• The hardware architecture (the software architect in turn • Many software projects and products are considered failures
provides requirements to the system architect, who configures because they did not actually solve a valid business problem or
have a recognizable return on investment (ROI).
the hardware architecture).
Identify Design Elements and their Relationships
• The result or output of the architecture design process is • In this phase, build a baseline for defining the boundaries and
an architectural description. The basic architecture design context of the system.
process is composed of the following steps − • Decomposition of the system into its main components based on
functional requirements. The decomposition can be modeled using a
Understand the Problem design structure matrix (DSM), which shows the dependencies
• This is the most crucial step because it affects the quality of the between design elements without specifying the granularity of the
elements.
design that follows. • In this step, the first validation of the architecture is done by
• Without a clear understanding of the problem, it is not possible describing a number of system instances and this step is referred as
functionality based architectural design.
to create an effective solution.
Evaluate the Architecture Design
Transform the Architecture Design
• Each quality attribute is given an estimate so in order to gather • This step is performed after an evaluation of the architectural design. The
qualitative measures or quantitative data, the design is architectural design must be changed until it completely satisfies the
evaluated. quality attribute requirements.
• It involves evaluating the architecture for conformance to • It is concerned with selecting design solutions to improve the quality
architectural quality attributes requirements. attributes while preserving the domain functionality.
• If all estimated quality attributes are as per the required • A design is transformed by applying design operators, styles, or patterns.
For transformation, take the existing design and apply design operator
standard, the architectural design process is finished. such as decomposition, replication, compression, abstraction, and
• If not, the third phase of software architecture design is resource sharing.
entered: architecture transformation. If the observed quality • The design is again evaluated and the same process is repeated multiple
attribute does not meet its requirements, then a new design times if necessary and even performed recursively.
must be created. • The transformations (i.e. quality attribute optimizing solutions) generally
improve one or some quality attributes while they affect others negatively
Design Steps
The preceding example will be used to illustrate each step in
transform mapping. The steps begin with a re-evaluation of work
done during requirements analysis and then move to the design
of the software architecture.
Step 1. Review the fundamental system model.
The fundamental system model encompasses the level 0 DFD and
supporting information.
The design step begins with an evaluation of both the System
During requirements analysis, more detailed flow models would be created for SafeHome. In
Specification and the Software Requirements Specification.
addition, control and process specifications, a data dictionary, and various behavioral Both documents describe information flow and structure at the
models would also be created. software interface. Figure 1 and 2 depict level 0 and level 1 data
flow for the SafeHome software.
Step 2. Review and refine data flow diagrams for the
software.
• Information obtained from analysis models contained in the
Software Requirements Specification is refined to produce
greater detail.
• For example, the level 2 DFD for monitor sensors is examined,
and a level 3 data flow diagram is derived .
• At level 3, each transform in the data flow diagram exhibits
relatively high cohesion.
• That is, the process implied by a transform performs a single,
distinct function that can be implemented in the SafeHome
software.
• Step 5. Perform "first-level factoring." Program structure • Step 6. Perform "second-level factoring." Second-level
represents a top-down distribution of control. factoring is accomplished by mapping individual transforms
(bubbles) of a DFD into appropriate modules within the
• Factoring results in a program structure in which top-level architecture.
modules perform decision making and low-level modules
perform most input, computation, and output work. Middle- • Beginning at the transform center boundary and moving
level modules perform some control and do moderate amounts outward along incoming and then outgoing paths, transforms
of work. are mapped into subordinate levels of the software structure.
•
• Step 7. Refine the first-iteration architecture using design
heuristics for improved software quality. Refactoring of designs
• A first-iteration architecture can always be refined by applying Refactoring is the process of restructuring code, while not
concepts of module independence . Modules are exploded or changing its original functionality. The goal of refactoring is to
imploded to produce sensible factoring, good cohesion, improve internal code by making many small changes without
minimal coupling, and most important, a structure that can be altering the code's external behavior.
implemented without difficulty, tested without confusion, and software developers refactor code to improve the design,
maintained without grief. structure and implementation of software. Refactoring improves
code readability and reduces complexities.
These changes preserve the software's original behavior and do
not modify its behavior.
• Typically capable of more important tasks. Icons Icons different types of information. On some
systems, icons represent files. On other icons
• Disadvantages describes processes.
• Relies heavily on recall rather than recognition. Menus Commands are selected from a menu rather than
typed in a command language.
• Navigation is often more difficult. Pointing A pointing device such as a mouse is used for
selecting choices from a menu or indicating items
Graphical User Interface (GUI): GUI relies much more heavily on the of interests in a window.
In this chapter we will: State diagrams describe the life of an object using
Introduce the terms used with respect to state three main elements:
diagrams States of an object
Transitions between states
Discuss the context in which state diagrams are Events that trigger the transitions
used
Introduce substates A state diagram or statechart specifies a state
Discuss concurrent state diagrams machine
A state machine is described for a class
Each object has it’s own state machine
Object-Oriented Software Systems Engineering – Chapter 5 Slide 2 Object-Oriented Software Systems Engineering – Chapter 5 Slide 3
Why Use Statechart Diagrams? States
Statecharts typically are used to describe state-dependent Show what the dependencies are between the
behaviour for an object state of an object and its reactions to messages
An object responds differently to the same event depending on or other events
what state it is in State
Usually applied to objects but can be applied to any element is a condition or situation during the life of an object
that has behaviour within which it performs some activity, or waits for some
Actors, use cases, methods, subsystems, systems
events
Has a name
Statecharts are typically used in conjunction with interaction Has actions -- execute the state
diagrams (usually sequence diagrams) Has internal transitions -- transitions cause no change in
a state
A statechart describes all events (and states and transitions for substates -- the nested structure of a state involving
a single object) disjoint or concurrent substates
A sequence diagram describes the events for a single
interaction across all objects involved
Object-Oriented Software Systems Engineering – Chapter 5 Slide 4 Object-Oriented Software Systems Engineering – Chapter 5 Slide 5
Object-Oriented Software Systems Engineering – Chapter 5 Slide 6 Object-Oriented Software Systems Engineering – Chapter 5 Slide 7
Initial and Final States
An example:
go to work
die die
Action
is an executable atomic computation
includes operation calls, the creation or destruction of
another object, or the sending of a signal to an object
associated with transitions and during which an action is
not interruptible -- e.g., entry, exit
Activity is associated with states
Non-atomic or ongoing computation
May run to completion or continue indefinitely
Will be terminated by an event that causes a transition
from the state in which the activity is defined
Events Events
An event signature is described as A time event occurs after a specified time has
Event-name (comma-separated-parameter-list) elapsed
Events appear in the internal transition Event name is specified as keyword after
compartment of a state or on a transition between Parameter list is an expression evaluating to a time
states interval
An event may be one of four types after(10 seconds after state “At Work” is entered)
Signal event No specified start time implies “since entry to the current
Corresponding to the arrival of an asynchronous message state”
or signal
Call event after(2 seconds)
Corresponding to the arrival of a procedural call to an
operation
Time event
Change event
Object-Oriented Software Systems Engineering – Chapter 5 Slide 14 Object-Oriented Software Systems Engineering – Chapter 5 Slide 15
Events Transitions
A change event occurs whenever a specified A transition is drawn as an arrow between states
condition is met annotated with a transition string
Event name is specified as keyword when The transition string denotes the event and
Parameter list is a boolean expression consequent action
The event occurs when both of the following conditions Only one form of arrowhead is used on statecharts
are met, irrespective of the order when they happen
The distinction between call events and signal events must be
The expression evaluates to true deducted from elsewhere e.g. an interaction diagram
The object is in the required state
For example
A transition string is described as
when (state = At Work)
Event-signature [guard-condition]/action-expression^object.message
when (date = January 1 2007)
If the guard condition is met the transition occurs immediately
Object-Oriented Software Systems Engineering – Chapter 5 Slide 16 Object-Oriented Software Systems Engineering – Chapter 5 Slide 17
Transitions Transitions
A transition whose string contains neither an A transition is triggered when its event occurs
event signature nor a guard condition is said to be If the guard condition is met, the transition is fired
unlabeled If the condition is not met the event is discarded
The guard condition is checked only once
Occurs immediately
If there is no guard condition, triggering will
May still carry an action expression
always cause firing
Note the distinction between a guard condition
and a change event
A guard condition is evaluated once, when the
associated event occurs
A change event occurs whenever its associated
condition is met
Behaviour is as if the condition were being continually
evaluated
Object-Oriented Software Systems Engineering – Chapter 5 Slide 18 Object-Oriented Software Systems Engineering – Chapter 5 Slide 19
State Diagrams notation State Diagram Example
get first item all items
in stock
[all items checked &&
*[all items checked]
all items available]
get next item Checking Dispatching
Dispatch items
Initial state event final state do / check
name Item do / initiate
[all items checked delivery
&& some items not
Invoice Invoice in stock] delivery
created paying destroyed Order Item
Unpaid Paid
Canceling
do / Remove
Item
Object-Oriented Software Systems Engineering – Chapter 5 Slide 20 Object-Oriented Software Systems Engineering – Chapter 5 Slide 21
C event-2 Ordering
Exit/ Item received
C do / order Item
Canceling Delivering
cancelled
do / Remove entry / deliver
Item Items
Object-Oriented Software Systems Engineering – Chapter 5 Slide 22 Object-Oriented Software Systems Engineering – Chapter 5 Slide 23
Concurrent State models
UNIT I UML DIAGRAMS
B
s Finishing
Starting
A C
Introduction to OOAD – Unified Process –
E T
UML diagrams – Use Case – Class Diagrams–
Explicit control
branching(fork)
D G
Interaction Diagrams – State Diagrams –
F Activity Diagrams –
Overview
• State Diagram Model the dynamic aspect of a system
Describe all of the possible states • A Statechart diagram describes a state machine.
• To describe different states of an object during its life time. An event is a significant or noteworthy occurrence.
For example:
Transitions are shown as arrows, labeled with their event. Subject of a Statechart Diagram:
States are shown in rounded rectangles. A statechart diagram may be applied to a variety of UML
elements, including:
• classes (conceptual or software)
• use cases
Since an entire "system" may be represented by a class,
it too may have its own statechart diagram.
Basic notational elements How to Draw: State Diagrams
• Filled circle
– Represent the initial state
• Rounded rectangle
– Denote a state.
Activity section of the state symbol depicts
what activities the object will be doing while it is in that state.
• Arrow, denoting transition.
Conditions based on the activities When the object enters the Checking state
can determine what the next state it performs the activity "check items."
the object transitions to.
After the activity is completed the object transitions to next state based on conditions
[all items available] or [an item is not available].
After this activity is complete the object transitions to the Delivered state.
Super-State Super-State
• State diagrams can also show a super-state for the object.
• Instead of showing all transitions from each state to the redundant state
– A super-state can be used to show that all the states inside of the super-state • Both Checking and Dispatching states can transition into Canceled state
can transition to the redundant state.
Example
Main Usage of State Diagram
Activity Diagram
2. To model reactive system.
– Reactive system consists of reactive objects.
05 October, 2007 Information System Design 05 October, 2007 Information System Design
IT60105, Autumn 2007 IT60105, Autumn 2007
Basic Components in an Activity Diagram Basic Components in an Activity Diagram
be horizontal or vertical
05 October, 2007 Information System Design 05 October, 2007 Information System Design
IT60105, Autumn 2007 IT60105, Autumn 2007
3. Conditions
• High level understanding of the system's functionalities.
4. Constraints
Duration : 3 Hrs
Ramakant Soni
Assistant Professor
Dept. of Computer Science
B K Birla Institute of Engineering & Technology, Pilani, India
Activity diagram is basically a flow chart to Activity diagrams are not only used for visualizing
represent the flow from one activity to another dynamic nature of a system but they are also used to
construct the executable system by using forward and
activity.
reverse engineering techniques.
The activity can be described as an operation It does not show any message flow from one activity to
of the system. another.
So the purposes can be described as to: Before drawing an activity diagram we must have a
clear understanding about the elements used in activity
• Draw the activity flow of a system. diagram.
Final node
The filled circle with a boarder is the ending point. An Flow/ edge
activity diagram can have zero or more activity final The arrows in the diagram. No label is necessary.
state.
Swimlanes -
Activity Diagrams that show
activities by class.
Scenario:
Scenario:
“Activity is started by Commuter actor who needs to buy a
ticket. Ticket vending machine will request trip information from
Commuter. This information will include number and type of
tickets, e.g. whether it is a monthly pass, one way or round
ticket, route number, destination or zone number, etc.
Scenario:
Exercise 4: Single Sign- on for Google Apps Activity diagram: Single Sign- on for Google Apps
Scenario:
To interact with partner companies Google uses single sign-on based on OASIS SAML 2.0
protocol. Google acts as service provider with services such as Gmail or Start Pages. Partner
companies act as identity providers and control user names, passwords, and other information
used to identify, authenticate and authorize users for web applications that Google hosts. Each
partner provides Google with the URL of its SSO service as well as the public key that Google will
use to verify SAML responses.
When a user attempts to use some hosted Google application, such as Gmail, Google generates
a SAML authentication request and sends redirect request back to the user's browser. Redirect
points to the specific identity provider. SAML authentication request contains the encoded URL
of the Google application that the user is trying to reach.
The partner identity provider authenticates the user by either asking for valid login credentials
or by checking for its own valid authentication cookies. The partner generates a SAML response
and digitally signs it. The response is forwarded to Google's Assertion Consumer Service (ACS).
Google's ACS verifies the SAML response using the partner's public key. If the response is valid
and user identity was confirmed by identity provider, ACS redirects the user to the destination
URL. Otherwise user will see error message.
Ramakant Soni @ BKBIET Pilani 28 Ramakant Soni @ BKBIET Pilani 29
1
References:
[1] http://www.uml-diagrams.org/
[2] http://en.wikipedia.org/wiki/Activity_diagram
2nd December 2014
[3] http://www.visual-paradigm.com/VPGallery/diagrams/Activity.html 14h 00-17h 00
[5] http://www.uml-diagrams.org/activity-diagrams-examples.html
Ramakant Soni
Assistant Professor
Thanks Dept. of Computer Science
B K Birla Institute of Engineering & Technology, Pilani, India
[email protected]
Ramakant Soni @ BKBIET Pilani 4/26/2015 30
A Sequence diagram is an interaction diagram that An organization's technical staff can find sequence
shows diagrams useful in documenting how a future system
should behave.
-- how the objects and classes involved in the scenario
operate with one another. During the design phase, architects and developers
can use the diagram to force out the system's object
-- the sequence of messages exchanged . interactions, thus fleshing out overall system design.
Ramakant Soni @ EISTI Cergy 12/2/2014 2 Ramakant Soni @ EISTI Cergy 12/2/2014 3
Its Use Targets
One of the primary uses of sequence diagrams is in the
transition from requirements expressed as use cases to Objects as well as classes can be targets which means
the next level of refinement. that messages can be sent to them.
Use cases are often refined into one or more sequence A target is displayed as a rectangle with some text in it.
diagrams.
Below the target, its lifeline(vertical dashed line) extends
In addition to their use in designing new systems, for as long as the target exists.
sequence diagrams can be used to document how
objects in an existing system currently interact. Target
Ramakant Soni @ EISTI Cergy 12/2/2014 4 Ramakant Soni @ EISTI Cergy 12/2/2014 5
Ramakant Soni @ EISTI Cergy 12/2/2014 6 Ramakant Soni @ EISTI Cergy 12/2/2014 7
Messages Message Notation
Ramakant Soni @ EISTI Cergy 12/2/2014 8 Ramakant Soni @ EISTI Cergy 12/2/2014 9
Its type:
- Synchronous Call
- Asynchronous Call
Ramakant Soni @ EISTI Cergy 12/2/2014 10 Ramakant Soni @ EISTI Cergy 12/2/2014 11
Synchronous Call Asynchronous Call- Send
Synchronous call typically represents operation call - Asynchronous call - send message and proceed
send message and suspend execution while waiting for immediately without waiting for return value.
response. Synchronous call messages are shown with Asynchronous messages have an open arrow head.
filled arrow head.
Ramakant Soni @ EISTI Cergy 12/2/2014 12 Ramakant Soni @ EISTI Cergy 12/2/2014 13
Create message is sent to a lifeline to create itself. It is Delete message is sent to terminate another lifeline. The
shown as a dashed line with open arrowhead. lifeline usually ends with a cross in the form of an X at
the bottom denoting destruction occurrence.
Ramakant Soni @ EISTI Cergy 12/2/2014 14 Ramakant Soni @ EISTI Cergy 12/2/2014 15
Return Message Self Message
Ramakant Soni @ EISTI Cergy 12/2/2014 16 Ramakant Soni @ EISTI Cergy 12/2/2014 17
Ramakant Soni @ EISTI Cergy 12/2/2014 20 Ramakant Soni @ EISTI Cergy 12/2/2014 21
Ramakant Soni @ EISTI Cergy 12/2/2014 22 Ramakant Soni @ EISTI Cergy 12/2/2014 23
Interaction Operands Interaction Operands Example
Ramakant Soni @ EISTI Cergy 12/2/2014 24 Ramakant Soni @ EISTI Cergy 12/2/2014 25
User receives back Request for Permission form. If the user authorizes the
application to get his/her data, Facebook authorization server redirects
back to the URI that was specified before together with authorization
code ("verification string"). The authorization code can be exchanged
by web application for an OAuth access token.
Ramakant Soni @ EISTI Cergy 12/2/2014 26 Ramakant Soni @ EISTI Cergy 12/2/2014 27
Sequence
Diagram
For
Facebook
If web application obtains the access token for a FB user, it can
perform authorized requests on behalf of that FB user by including the
Authentication
access token in the Facebook Graph API requests. If the user did not Process
authorize web application, Facebook issues redirect request to the URI
specified before, and adds the error_reason parameter to notify the
web application that authorization request was denied.
Ramakant Soni @ EISTI Cergy 12/2/2014 28 Ramakant Soni @ EISTI Cergy 12/2/2014 29
UML Diagrams for ATM: Use Case UML Diagrams for ATM: Sequence diagram
Ramakant Soni @ EISTI Cergy 12/2/2014 30 Ramakant Soni @ EISTI Cergy 12/2/2014 31
UML Diagrams for ATM: class diagram Exercise:
To generate sequence diagram using use case
Steps:-
1. Designate actors and business system—Who is taking part?
Ramakant Soni @ EISTI Cergy 12/2/2014 32 Ramakant Soni @ EISTI Cergy 12/2/2014 33
Home Heating
«includes»
Power Down Adjust Temp
«includes»
Home Owner
Ramakant Soni @ EISTI Cergy 12/2/2014 34 Ramakant Soni @ EISTI Cergy 12/2/2014 35
Exercise: Online Shopping
References:
[1] http://www.uml-diagrams.org/
[2] http://www.wikipedia.com/UML%diagrams
[3] http://staruml.sourceforge.net/docs/user-guide%28en%29/ch05_3.html
[5] http://www.uml-diagrams.org/sequence-diagrams-examples.html
Ramakant Soni @ EISTI Cergy 12/2/2014 36 Ramakant Soni @ EISTI Cergy 12/2/2014 37