Professional Documents
Culture Documents
UNIT-5
Syllabus:-Software Architecture and Design:
Software Architecture: Role of software architecture,
architecture views, components and connector view,
architecture styles for C & C view.
Design: Function-oriented design, object oriented design,
metrics for design.
5.1 Role of Software Architecture
can be used to analyze the system before the system is actually built. It
allows the designers to analyze the system in terms of its cost, reliability,
performance, etc.
assumptions about the request load and hardware. It can then be decided
components.
An Allocation view focuses on how the different software units are
processor, and how the system files are organized on a file system.
For example, the allocation view of library system is shown below.
5.5 Function Oriented Design
Data flow arrows: Arrows are annotated with data name; named data
passes from one module to another module in the direction of the arrow.
partitioning.
That is, the System is decomposed into modules, modules are then
decomposed into sub modules, sub modules are then decomposed into sub-
sub modules and so on until the modules are small enough to handle them
2. First-level factoring
3. Identify the input and output data elements
4. Factoring of input, output and transform branches
1. Restate the problem as a data flow diagram
To use this methodology, the first step is to construct the data flow diagram
for the problem
The DFD (also known as a bubble chart) is a hierarchical graphical model
of a system that shows the different processing activities or functions that
the system performs and the data exchanged among these functions.
Each function is considered as a processing station (or process) that
consumes some input data and produces some output data.
The system is represented in terms of the input data to the system,
various processing carried out on these data, and the output data generated
by the system.
A DFD model uses a very limited number of primitive symbols as shown
below.
Example 1: RMS calculating software
In this example, the context diagram (shown here) is simple to draw.
The system accepts three integers from the user and returns the result
to him.
2. First-level Factoring
After factoring the DFD, the next step is to identify the input and output
elements in the DFD.
An input element in a DFD represents a process or processes which
convert input data from physical to logical form. For eg Reading characters
from the terminal and storing them in the internal table list is considered as
an input element.
In the above DFD, Read-numbers is the input element.
Similarly, an output element in a DFD is one which transforms output
data from logical form to physical form. Ex. From list or array into output
characters.
In the above DFD, Display is the output element
In addition to input and output elements it is also required to identify the
transformation elements in the DFD.
For eg, in the above DFD Compute-RMS is a transformation element
4. Factoring of input, output, and transform branches
DFD the next step is to factor them further. That is, decompose the input
input file. The data flow diagram for this problem is shown below.
1. Function-oriented design
It is the traditional design.
In function-oriented design, the system is decomposed into set of functions
called modules forming a hierarchical structure of the system.
Here, the main building block is function or module.
It follows top-down approach (i.e. the system is decomposed into modules,
modules are then decomposed into sub modules, sub modules are then
decomposed into sub-sub modules and son).
Each module can be coded in a procedural language like C.
2. Object-oriented design
software objects and how they collaborate to full fill the requirements.
with the Book object to full fill the requirement Issue book.
Example 1
With these classes, now we can able to create the initial class diagram as
shown below.
In order to find the operations of these classes, we need to create the
interaction diagram for the Dice Game. The interaction diagram is shown
below.
Notice that although in the real world a player rolls the dice, in the
software design the Dice Game object "rolls" the dice.
An inspection of the interaction diagram leads to the final class diagram
shown below. Since a play message is sent to a Dice Game object,
• The Dice Game class requires a play method,
• While, class Die requires a roll and getFaceValue method
Example 2