Jjhi
Jjhi
Jjhi
DESIGN CONCEPTS
• Design creates a representation or model of the software.
• Unlike the requirements model (that focuses on describing required data,
function, and behavior), the design model provides detail about software
architecture, data structures, interfaces, and components that are necessary to
implement the system.
• Software engineers conduct each of the design tasks.
• This model can be assessed for quality and improved before code is generated.
Design depicts the software in a number of different ways.
• First, the architecture of the system or product must be represented.
• Then, the interfaces that connect the software to end users, to other systems and
devices, and to its own constituent components are modeled.
• Finally, the software components that are used to construct the system are
designed.
DESIGN CONCEPTS
• A set of fundamental software design concepts has evolved over the history of
software engineering. Important software design concepts that span both
traditional and object-oriented software development are discussed below:
1) Abstraction.
• At the highest level of abstraction, a solution is stated in broad terms using the
language of the problem environment.
• At lower levels of abstraction, a more detailed description of the solution is
provided.
• As different levels of abstraction are developed, you work to create both
procedural and data abstractions.
• A procedural abstraction refers to a sequence of instructions that have a specific and
limited function.
• A data abstraction is a named collection of data that describes a data object.
2. Architecture
•Software architecture alludes to “the overall structure of the software and the
ways in which that structure provides conceptual integrity for a system”.
•In its simplest form, architecture is the structure or organization of program
components (modules), the manner in which these components interact, and the
structure of data that are used by the components.
•A set of properties that should be specified as part of an architectural design are:
• Structural properties. This aspect of the architectural design representation
defines the components of a system (e.g., modules, objects, filters) and the
manner in which those components are packaged and interact with one
another.
• Extra-functional properties. The architectural design description should
address how the design architecture achieves requirements for performance,
capacity, reliability, security, adaptability, and other system characteristics.
• Families of related systems. The architectural design should draw upon
repeatable patterns that are commonly encountered in the design of families
of similar systems.
3. Patterns
• A design pattern describes a design structure that solves a particular design
problem within a specific context and amid “forces” that may have an impact on
the manner in which the pattern is applied and used.
• The intent of each design pattern is to provide a description that enables a
designer to determine
(1) whether the pattern is applicable to the current work,
(2) whether the pattern can be reused (hence, saving design time), and
(3) whether the pattern can serve as a guide for developing a similar, but
functionally or structurally different pattern.
4. Separation of Concerns
•Separation of concerns is a design concept that suggests that any complex
problem can be more easily handled if it is subdivided into pieces that can each be
solved and/or optimized independently.
•A concern is a feature or behavior that is specified as part of the requirements
model for the software.
•By separating concerns into smaller, and therefore more manageable pieces, a
problem takes less effort and time to solve.
•Separation of concerns is manifested in other related design concepts: modularity,
aspects, functional independence, and refinement.
5. Modularity.
•Modularity is the most common
manifestation of separation of concerns.
•Software is divided into separately named
and addressable components, sometimes
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”.
•You modularize a design (and the resulting
program) so that development can be more
easily planned; software increments can be
defined and delivered; changes can be more
easily accommodated; testing and debugging
can be conducted more efficiently, and long-
term maintenance can be conducted without
6. Information Hiding
• Hiding implies that effective modularity can be achieved by defining a set of
independent modules that communicate with one another only that information
necessary to achieve software function.
• Abstraction helps to define the procedural (or informational) entities that make
up the software. Hiding defines and enforces access constraints to both
procedural detail within a module and any local data structure used by the
module.
• The use of information hiding as a design criterion for modular systems provides
the greatest benefits when modifications are required during testing and later
during software maintenance.
• Because most data and procedural detail are hidden from other parts of the
software, inadvertent errors introduced during modification are less likely to
propagate to other locations within the software.
7. Functional Independence
•Functional independence is achieved by developing modules with “singleminded”
function and an “aversion” to excessive interaction with other modules.
•Stated another way, you should design software so that each module addresses a
specific subset of requirements and has a simple interface when viewed from other
parts of the program structure.
•Software with effective modularity, that is, independent modules, is easier to
develop because function can be compartmentalized and interfaces are simplified.
• Independent modules are easier to maintain (and test) because secondary effects
caused by design or code modification are limited, error propagation is reduced,
and reusable modules are possible.
• Independence is assessed using two qualitative criteria: cohesion and coupling.
• Cohesion is an indication of the relative functional strength of a module.
• Cohesion is a natural extension of the information-hiding concept.
• A cohesive module performs a single task, requiring little interaction with other
components in other parts of a program.
• A cohesive module should (ideally) do just one thing.
• Although you should always strive for high cohesion (i.e., single-mindedness), it is
often necessary and advisable to have a software component perform multiple
functions. However, “schizophrenic” components (modules that perform many
unrelated functions) are to be avoided if a good design is to be achieved.
• Coupling is an indication of the relative interdependence among modules.
• Coupling is an indication 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, you should strive for the 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 throughout a system).
8. Refinement
• A hierarchy is developed by decomposing a macroscopic statement of function (a
procedural abstraction) in a stepwise fashion until programming language
statements are reached.
• Refinement is actually a process of elaboration.
• You begin with a statement of function (or description of information) that is
defined at a high level of abstraction. That is, the statement describes function or
information conceptually but provides no information about the internal
workings of the function or the internal structure of the information.
• You then elaborate on the original statement, providing more and more detail as
each successive refinement (elaboration) occurs.
9. Refactoring
• Refactoring is a reorganization technique that simplifies the design (or code) of a
component without changing its function or behavior.
• Refactoring is the process of changing a software system in such a way that it
does not alter the external behavior of the code [design] yet improves its internal
structure.
• When software is refactored, the existing design is examined for redundancy,
unused design elements, inefficient or unnecessary algorithms, poorly
constructed or inappropriate data structures, or any other design failure that can
be corrected to yield a better design.
• For example, a first design iteration might yield a component that exhibits low
cohesion (i.e., it performs three functions that have only limited relationship to
one another). After careful consideration, you may decide that the component
should be refactored into three separate components, each exhibiting high
cohesion.
10. Object-Oriented Design Concepts
The object-oriented (OO) paradigm is widely used in modern software engineering.