Software Design (Unit 3)
Software Design (Unit 3)
1.
2.
3.
4.
5.
6.
7.
8.
9.
Abstract
1: disassociated from any specific instance 2: difficult to
understand.
Example of abstraction:
a. Unix file descriptor
b. Can read, write, and (maybe) seek
c. File, IO device, pipe
Kinds of abstraction :
Procedural abstraction
i.
Naming a sequence of instruction
ii.
Parameterizing a procedure
Data abstraction
i.
Naming a collection of data
ii.
Data type defined by a set of procedures
Control abstraction
Performance abstraction
Modularity: Modularity refers to breaking down software into
different parts. These parts have different names depending on
your programming paridigm (for example, we talk about modules
in imperative programming and objects in object oriented
programming). By breaking the project down into pieces, it's (1)
easier to both FIX (you can isolate problems easier) and (2) allows
you to REUSE the pieces.
or
Is the degree to which a system's components may be separated
and recombined. The meaning of the word, however, can vary
somewhat by context:
In software design, modularity refers to a logical partitioning of
the "software design" that allows complex software to be
manageable for the purpose of implementation and maintenance.
The logic of partitioning may be based on related functions,
implementation considerations, data links, or other criteria.
Software architecture embodies
modularity; that is, software is divided into separately named and
addressable components, often called modules that are
integrated to satisfy problem requirements.
It has been stated that "modularity is the single attribute of
software that allows a program to be intellectually manageable".
Monolithic software (i.e., a large program
software architecture
The term software architecture intuitively denotes the high level
structures of a software system. It can be defined as the set of
structures needed to reason about the software system, which
comprise the software elements, the relations between them, and the
properties of both elements and relations.
The term software architecture also denotes the set of practices used
to select, define or design a software architecture.
Note:
It is unnecessary to determine the precise level of cohesion. Rather it
is important to strive for high cohesion and recognize low cohesion so
that software design can be modified to achieve greater functional
independence.
2. Coupling
Coupling is a measure of interconnection among modules in a software
structure. Coupling depends on the interface complexity between
modules, the point at which entry or reference is made to a module,
and what data pass across the interface.
In software design, we strive for lowest possible coupling. Simple
connectivity among modules results in software that is easier to
understand and less prone to a "ripple effect", caused when errors
occur at one location and propagate through a system.
Figure 1 provides examples of different types of module coupling.
interface complexity.
structure chart :
A structure chart is a top-down modular design tool, constructed of
squares representing the different modules in the system, and lines
that connect them. The lines represent the connection and or
ownership between activities and subactivities as they are used in
organization charts.
the
other.
program fizzbuzz
do i = 1 to 100
set print_number to true
if i is divisible by 3
print "Fizz"
set print_number to false
if i is divisible by 5
print "Buzz"
set print_number to false
if print_number, print i
print a newline
end do
procedure fizzbuzz
for i := 1 to 100 do
set print_number to true;
if i is divisible by 3 then
print "Fizz";
set print_number to false;
if i is divisible by 5 then
print "Buzz";
set print_number to false;
if print_number, print i;
print a newline;
end
FLOWCHART SYMBOLS:
Measurement Method :
We formally specify a scenario as = (SE, SE, SO, MEO, MET),
where SE represents all the environmental (Input/Output) events
participating in the scenario, SE is an order imposed on the
events in time, SO is the set of domain concepts participating in
the scenario, MEO is a mapping from SE to the pairs of objects
that exchange events, and MET is a mapping from SE to the time
axis. The environmental Input/Output events in a scenario are
0 indicates the lack of cohesion in the use-case thus requiring reanalysis of the functional requirements related to this use-case.
Cohesion measurement in a use-case model. We state that a
crosscutting concern is a subgoal corresponding to a legal
subsequence common to at least two scenarios belonging to
different use cases. Let two different use-cases U1 and U2 be
presented by the sets of scenarios 1 and 2 respectively.
Intuitively, the existence of similar scenarios in different usecases indicates a low level of separation of concerns, i.e., low
level of partitioning quality. The non-empty intersection of the
sets of legal subsequences characterizing 1 and 2 not only
indicate the presence of candidate crosscutting concerns
(aspects), but also identifies U1 and U2 as candidates for
crosscutting functional requirements. Thus, our cohesion
measurement mechanism contributes to the Analysis and
crosscuttings realization activity of our AOSD framework (see
Figure 1)
The Cohesion Level in the Use-Case Model measure is defined on
the set of all scenarios belonging to all use-cases in the use-case
model:
CL_UCM = 1-|QM|/|PM|
where QM is the set of the pairs of similar scenarios, each pair
containing scenarios belonging to different use-cases, and PM is
the set of all pairs of scenarios (same condition apply).
The Steps 1 and 2 of the CL_UCM measurement method are
identical to the corresponding steps in CL_UC. The rest of the
steps are described below:
Step 3. At this step, the set Q is identified. For each pair of
scenarios (order is not important to avoid duplication of the
results) find the intersection of the corresponding sets of legal
subsequences. If the intersection is nonempty, add the pair to the
set Q. The non-empty intersections not only indicate the presence
of candidate crosscutting concerns, but also identify them.
Step 4. Calculate |PM|.
Step 5. Calculate CL_UCM.
The unit of cohesion in the CL_UCM measure is a crosscutting
concern abstracted as a pair of scenarios whose goals are related
where
1, iff Cc=> Cs ^ Cc Cs
0, otherwise
coupling.
No. Discussion: the number of coupled pairs of concepts will
remain the same, the number of classes might increase, therefore
the CF value would in general change.
6. Coupling forms a weak order.
Yes. Discussion: domain models can be ordered in terms of
their coupling.
The following section
Function-oriented design
A function-oriented design strategy relies on decomposing the system into a set of
interacting functions with a centralised system state shared by these functions
(Figure 15.1). Functions may also maintain local state information but only for the
duration of their execution..
Function-oriented design conceals the details of an algorithm in a function but
system state information is not hidden. This can cause problems because a
function can change the state in a way which other functions do not expect.
Changes to a function and the way in which it uses the system state may cause
unanticipated changes in the behaviour of other functions.
A functional approach to design is therefore most likely to be successful
when the amount of system state information is minimised and information sharing
is explicit. Systems whose responses depend on a single stimulus or input and
which are not affected by input histories are naturally functionally-oriented. Many
transaction-processing systems and business data-processing systems fall into this
class. In essence, they are concerned with record processing where the processing of
one record is not dependent on any previous processing.
An example of such a transaction processing system is the software which
controls automatic teller machines (ATMs) which are now installed outside many
banks. The service provided to a user is independent of previous services provided so
can be thought of as a single transaction.
Function-oriented design
Account_number := Read_card ;
Get_account_details (PIN, Account_balance, Cash_available) ;
if Validate_card (PIN) then
loop
Print_operation_select_message ;
case Get_button is
when Cash_only =>
Dispense_cash (Cash_available, Amount_dispensed) ;
when Print_balance =>
Print_customer_balance (Account_balance) ;
when Statement =>
Order_statement (Account_number) ;
when Check_book =>
Order_checkbook (Account_number) ;
end case ;
Eject_card ;
Print (Please take your card or press CONTINUE) ;
exit when Card_removed ;
end loop ;
Update_account_information (Account_number, Amount_dispensed) ;
else
Retain_card ;
end if ;
end loop ;
Object-oriented design:
An object contains encapsulated data and procedures grouped together to represent an
entity. The 'object interface', how the object can be interacted with, is also defined. An
object-oriented program is described by the interaction of these objects. Object-oriented
design is the discipline of defining the objects and their interactions to solve a problem
that was identified and documented during object-oriented analysis.
What follows is a description of the class-based subset of object-oriented design, which
does not include object prototype-based approaches where objects are not typically
obtained by instancing classes but by cloning other (prototype) objects.
Both the sequential and concurrent designs of the OIRS are functional because the
principal decomposition strategy identifies functions such as Execute command,
Update index, etc. By contrast, an object-oriented design focuses on the entities in
the system with the functions part of these entities. There is not enough space here
to develop a complete object-oriented design but I show the entity decomposition in
this section. Notice that this is quite different from the functional system
decomposition.
Designing concepts:
Defining objects, creating class diagram from conceptual diagram: Usually map entity to
class.
Identifying attributes.
Use design patterns (if applicable): A design pattern is not a finished design, it is a
description of a solution to a common problem, in a context.[1] The main advantage of
using a design pattern is that it can be reused in multiple applications. It can also be
thought of as a template for how to solve a problem that can be used in many different
situations and/or applications. Object-oriented design patterns typically show
relationships and interactions between classes or objects, without specifying the final
application classes or objects that are involved.
Identify persistent objects/data (if applicable): Identify objects that have to last longer
than a single runtime of the application. If a relational database is used, design the object
relation mapping.
Top-down and bottom-up are both strategies of information processing and knowledge ordering,
used in a variety of fields including software, humanistic and scientific theories (see systemics),
and management and organization. In practice, they can be seen as a style of thinking and
teaching.
A top-down approach (also known as stepwise design or deductive reasoning, and in many
cases used as a synonym of analysis or decomposition) is essentially the breaking down of a
system to gain insight into its compositional sub-systems. In a top-down approach an overview
of the system is formulated, specifying but not detailing any first-level subsystems. Each
subsystem is then refined in yet greater detail, sometimes in many additional subsystem levels,
until the entire specification is reduced to base elements. A top-down model is often specified
with the assistance of "black boxes", these make it easier to manipulate. However, black boxes
may fail to elucidate elementary mechanisms or be detailed enough to realistically validate the
model. Top down approach starts with the big picture. It breaks down from there into smaller
segments.
A bottom-up approach (also known as inductive reasoning, and in many cases used as a
synonym of synthesis) is the piecing together of systems to give rise to grander systems, thus
making the original systems sub-systems of the emergent system. Bottom-up processing is a type
of information processing based on incoming data from the environment to form a perception.
Information enters the eyes in one direction (input), and is then turned into an image by the brain
that can be interpreted and recognized as a perception (output). In a bottom-up approach the
individual base elements of the system are first specified in great detail. These elements are then
linked together to form larger subsystems, which then in turn are linked, sometimes in many
levels, until a complete top-level system is formed. This strategy often resembles a "seed" model,
whereby the User interface design or user interface engineering is the design of computers,
appliances, machines, mobile communication devices, software applications, and websites with
the focus on the user's experience and interaction. The goal of user interface design is to make
the user's interaction as simple and efficient as possible, in terms of accomplishing user goals
what is often called user-centered design. Good user interface
design facilitates finishing the task at hand without drawing
unnecessary attention to itself. Graphic design may be utilized to
support its usability. The design process must balance technical
functionality and visual elements (e.g., mental model) to create a
system that is not only operational but also usable and adaptable to
changing user needs.
Interface design is involved in a wide range of projects from
computer systems, to cars, to commercial planes; all of these
projects involve much of the same basic human interactions yet also
require some unique skills and knowledge. As a result, designers
driving nails, but not much else), a computer has many affordances
for use and this takes place in an open-ended dialog between the
user and the computer.
Because humancomputer interaction studies a human and a
machine in conjunction, it draws from supporting knowledge on
both the machine and the human side. On the machine side,
techniques in computer graphics, operating systems, programming
languages, and development environments are relevant. On the
human side, communication theory, graphic and industrial design
disciplines, linguistics, social sciences, cognitive psychology, and
human factors such as computer user satisfaction are relevant.
Engineering and design methods are also relevant. Due to the
multidisciplinary nature of HCI, people with different backgrounds
contribute to its success. HCI is also sometimes referred to as man
machine interaction (MMI) or computerhuman interaction (CHI).
Attention to human-machine interaction is important because poorly
designed human-machine interfaces can lead to many unexpected
problems. A classic example of this is the Three Mile Island
accident, a nuclear meltdown accident, where investigations
concluded that the design of the humanmachine interface was at
least partially responsible for the disaster.Similarly, accidents in
aviation have resulted from manufacturers' decisions to use nonstandard flight instrument and/or throttle quadrant layouts: even
though the new designs were proposed to be superior in regards to
basic humanmachine interaction, pilots had already ingrained the
"standard" layout and thus the conceptually good idea actually had
undesirable results.
Human-computer interface :
What do these things have in common?
1. A Computer Mouse
2. A Touch Screen
3. A program on your Mac or Windows machine that includes a
trashcan, icons of disk drives, and folders
4. Pull-down menus
Interface design:
Interface design deals with the process of developing a method for
two (or more) modules in a system to connect and communicate.
These modules can apply to hardware, software or the interface
between a user and a machine. An example of a user interface could
include a GUI, a control panel for a nuclear power plant,or even the
cockpit of an aircraft.
In systems engineering, all the inputs and outputs of a system,
Interface standard:
In telecommunications, an interface standard is a standard that
describes one or more functional characteristics (such as code
conversion, line assignments, or protocol compliance) or physical
characteristics (such as electrical, mechanical, or optical
characteristics) necessary to allow the exchange of information
between two or more (usually different) systems or pieces of
equipment. Communications protocols are an example.
An interface standard may include operational characteristics and
acceptable levels of performance.
In the military community, interface standards permit command and
control functions to be performed using communication and
computer systems.