尊敬的 微信汇率:1円 ≈ 0.046166 元 支付宝汇率:1円 ≈ 0.046257元 [退出登录]
SlideShare a Scribd company logo
Chapter 11
Component-Level Design
- Introduction
- The software component
- Designing class-based components
- Designing conventional components

(Source: Pressman, R. Software Engineering: A Practitioner’s Approach. McGraw-Hill, 2005)
Introduction
Background
• Component-level design occurs after the first iteration of the
architectural design
• It strives to create a design model from the analysis and architectural
models
– The translation can open the door to subtle errors that are difficult to find
and correct later
– “Effective programmers should not waste their time debugging – they
should not introduce bugs to start with.” Edsgar Dijkstra

• A component-level design can be represented using some intermediate
representation (e.g. graphical, tabular, or text-based) that can be
translated into source code
• The design of data structures, interfaces, and algorithms should
conform to well-established guidelines to help us avoid the
introduction of errors

3
The Software Component
Defined
• A software component is a modular building block for computer
software
– It is a modular, deployable, and replaceable part of a system that
encapsulates implementation and exposes a set of interfaces

• A component communicates and collaborates with
– Other components
– Entities outside the boundaries of the system

• Three different views of a component
– An object-oriented view
– A conventional view
– A process-related view

5
Object-oriented View
•
•

A component is viewed as a set of one or more collaborating classes
Each problem domain (i.e., analysis) class and infrastructure (i.e.,
design) class is elaborated to identify all attributes and operations
that apply to its implementation
–

•
•

This also involves defining the interfaces that enable classes to
communicate and collaborate

This elaboration activity is applied to every component defined as
part of the architectural design
Once this is completed, the following steps are performed
1)
2)
3)
4)

Provide further elaboration of each attribute, operation, and interface
Specify the data structure appropriate for each attribute
Design the algorithmic detail required to implement the processing
logic associated with each operation
Design the mechanisms required to implement the interface to include
the messaging that occurs between objects

6
Conventional View
•

A component is viewed as a functional element (i.e., a module) of a
program that incorporates
– The processing logic
– The internal data structures that are required to implement the processing
logic
– An interface that enables the component to be invoked and data to be
passed to it

•

A component serves one of the following roles
– A control component that coordinates the invocation of all other problem
domain components
– A problem domain component that implements a complete or partial
function that is required by the customer
– An infrastructure component that is responsible for functions that support
the processing required in the problem domain

(More on next slide)

7
Conventional View (continued)
•

Conventional software components are derived from the data flow
diagrams (DFDs) in the analysis model
–

Each transform bubble (i.e., module) represented at the lowest levels of
the DFD is mapped into a module hierarchy
Control components reside near the top
Problem domain components and infrastructure components migrate
toward the bottom
Functional independence is strived for between the transforms

–
–
–

•

Once this is completed, the following steps are performed for each
transform
1)
2)
3)

Define the interface for the transform (the order, number and types of
the parameters)
Define the data structures used internally by the transform
Design the algorithm used by the transform (using a stepwise
refinement approach)

8
Process-related View
• Emphasis is placed on building systems from existing components
maintained in a library rather than creating each component from
scratch
• As the software architecture is formulated, components are selected
from the library and used to populate the architecture
• Because the components in the library have been created with reuse in
mind, each contains the following:
– A complete description of their interface
– The functions they perform
– The communication and collaboration they require

9
Designing Class-Based
Components
Component-level Design Principles
•

Open-closed principle
– A module or component should be open for extension but closed for modification
– The designer should specify the component in a way that allows it to be extended without the
need to make internal code or design modifications to the existing parts of the component

•

Liskov substitution principle
– Subclasses should be substitutable for their base classes
– A component that uses a base class should continue to function properly if a subclass of the
base class is passed to the component instead

•

Dependency inversion principle
– Depend on abstractions (i.e., interfaces); do not depend on concretions
– The more a component depends on other concrete components (rather than on the interfaces)
the more difficult it will be to extend

•

Interface segregation principle
– Many client-specific interfaces are better than one general purpose interface
– For a server class, specialized interfaces should be created to serve major categories of clients
– Only those operations that are relevant to a particular category of clients should be specified
in the interface

11
Component Packaging Principles
•

Release reuse equivalency principle
– The granularity of reuse is the granularity of release
– Group the reusable classes into packages that can be managed, upgraded,
and controlled as newer versions are created

•

Common closure principle
– Classes that change together belong together
– Classes should be packaged cohesively; they should address the same
functional or behavioral area on the assumption that if one class
experiences a change then they all will experience a change

•

Common reuse principle
– Classes that aren't reused together should not be grouped together
– Classes that are grouped together may go through unnecessary integration
and testing when they have experienced no changes but when other
classes in the package have been upgraded

12
Component-Level Design
Guidelines
• Components
– Establish naming conventions for components that are specified as part of
the architectural model and then refined and elaborated as part of the
component-level model
– Obtain architectural component names from the problem domain and
ensure that they have meaning to all stakeholders who view the
architectural model (e.g., Calculator)
– Use infrastructure component names that reflect their implementationspecific meaning (e.g., Stack)

• Dependencies and inheritance in UML
– Model any dependencies from left to right and inheritance from top (base
class) to bottom (derived classes)
– Consider modeling any component dependencies as interfaces rather than
representing them as a direct component-to-component dependency

13
Cohesion
•
•

Cohesion is the “single-mindedness’ of a component
It implies that a component or class encapsulates only attributes and
operations that are closely related to one another and to the class or
component itself
• The objective is to keep cohesion as high as possible
• The kinds of cohesion can be ranked in order from highest (best) to
lowest (worst)
– Functional
• A module performs one and only one computation and then returns a result

– Layer
• A higher layer component accesses the services of a lower layer component

– Communicational
• All operations that access the same data are defined within one class

(More on next slide)

14
Cohesion (continued)
• Kinds of cohesion (continued)
– Sequential
• Components or operations are grouped in a manner that allows the first to
provide input to the next and so on in order to implement a sequence of
operations

– Procedural
• Components or operations are grouped in a manner that allows one to be
invoked immediately after the preceding one was invoked, even when no data
passed between them

– Temporal
• Operations are grouped to perform a specific behavior or establish a certain
state such as program start-up or when an error is detected

– Utility
• Components, classes, or operations are grouped within the same category
because of similar general functions but are otherwise unrelated to each other

15
Coupling
• As the amount of communication and collaboration increases between
operations and classes, the complexity of the computer-based system
also increases
• As complexity rises, the difficulty of implementing, testing, and
maintaining software also increases
• Coupling is a qualitative measure of the degree to which operations
and classes are connected to one another
• The objective is to keep coupling as low as possible

(More on next slide)

16
Coupling (continued)
•

The kinds of coupling can be ranked in order from lowest (best) to
highest (worst)
– Data coupling
• Operation A() passes one or more atomic data operands to operation B(); the
less the number of operands, the lower the level of coupling

– Stamp coupling
• A whole data structure or class instantiation is passed as a parameter to an
operation

– Control coupling
• Operation A() invokes operation B() and passes a control flag to B that directs
logical flow within B()
• Consequently, a change in B() can require a change to be made to the meaning
of the control flag passed by A(), otherwise an error may result

– Common coupling
• A number of components all make use of a global variable, which can lead to
uncontrolled error propagation and unforeseen side effects

– Content coupling
• One component secretly modifies data that is stored internally in another
component
(More on next slide)

17
Coupling (continued)
• Other kinds of coupling (unranked)
– Subroutine call coupling
• When one operation is invoked it invokes another operation within side of it

– Type use coupling
• Component A uses a data type defined in component B, such as for an instance
variable or a local variable declaration
• If/when the type definition changes, every component that declares a variable
of that data type must also change

– Inclusion or import coupling
• Component A imports or includes the contents of component B

– External coupling
• A component communicates or collaborates with infrastructure components
that are entities external to the software (e.g., operating system functions,
database functions, networking functions)

18
Conducting Component-Level Design
1)

Identify all design classes that correspond to the problem domain as defined
in the analysis model and architectural model
Identify all design classes that correspond to the infrastructure domain

2)
•
•

1)

These classes are usually not present in the analysis or architectural models
These classes include GUI components, operating system components, data
management components, networking components, etc.

Elaborate all design classes that are not acquired as reusable components
a)
b)
c)
d)

Specify message details (i.e., structure) when classes or components collaborate
Identify appropriate interfaces (e.g., abstract classes) for each component
Elaborate attributes and define data types and data structures required to
implement them (usually in the planned implementation language)
Describe processing flow within each operation in detail by means of pseudocode
or UML activity diagrams

(More on next slide)

19
Conducting Component-Level
Design (continued)
4)

Describe persistent data sources (databases and files) and identify the
classes required to manage them
Develop and elaborate behavioral representations for a class or component

5)
•

4)

This can be done by elaborating the UML state diagrams created for the analysis
model and by examining all use cases that are relevant to the design class

Elaborate deployment diagrams to provide additional implementation detail
•

4)

Illustrate the location of key packages or classes of components in a system by
using class instances and designating specific hardware and operating system
environments

Factor every component-level design representation and always consider
alternatives
•
•

Experienced designers consider all (or most) of the alternative design solutions
before settling on the final design model
The final decision can be made by using established design principles and
guidelines

20
Designing Conventional
Components
Introduction
•

Conventional design constructs emphasize the maintainability of a
functional/procedural program
– Sequence, condition, and repetition

•
•

Each construct has a predictable logical structure where control enters
at the top and exits at the bottom, enabling a maintainer to easily
follow the procedural flow
Various notations depict the use of these constructs
– Graphical design notation
• Sequence, if-then-else, selection, repetition (see next slide)

– Tabular design notation (see upcoming slide)
– Program design language
• Similar to a programming language; however, it uses narrative text embedded
directly within the program statements

22
Graphical Design Notation
F

T

Sequence

If-then-else

T
F
F

F

T
T
T

F

Selection

Repetition

23
Graphical Example used for Algorithm Analysis

1
2
3

4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9

while (x <= (y * y))
{
if ((x % 11 == 0) &&
(x % y == 0))
{
printf(“%d”, x);
x++;
} // End if
else if ((x % 7 == 0) ||
(x % y == 1))
{
printf(“%d”, y);
x = x + 2;
} // End else
printf(“n”);
} // End while

0
1
2

printf("End of listn");
return 0;
} // End functionZ

3

int functionZ(int y)
{
int x = 0;

4
6
12

7

13

9
10

15
16
18
20
21
24
Tabular Design Notation
1)
2)
3)
4)

List all actions that can be associated with a specific procedure (or
module)
List all conditions (or decisions made) during execution of the
procedure
Associate specific sets of conditions with specific actions,
eliminating impossible combinations of conditions; alternatively,
develop every possible permutation of conditions
Define rules by indicating what action(s) occurs for a set of
conditions

(More on next slide)

25
Tabular Design Notation
(continued)
Rules
Conditions

1

2

Condition A

T

T

Condition B
Condition C

F

3

4
F

T

T

T

Actions
Action X






Action Y
Action Z




26




More Related Content

What's hot

Coupling and cohesion
Coupling and cohesionCoupling and cohesion
Coupling and cohesion
Sutha31
 
Software design
Software designSoftware design
Software design
Software designSoftware design
Software design
Benazir Fathima
 
Software Process Models
Software Process ModelsSoftware Process Models
Software Process Models
Hassan A-j
 
Software design
Software designSoftware design
Software design
Zulqarnaintayyab
 
Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modeling
ramyaaswin
 
Software Engineering - Ch1
Software Engineering - Ch1Software Engineering - Ch1
Software Engineering - Ch1
Siddharth Ayer
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategies
SHREEHARI WADAWADAGI
 
Software Engineering : Requirement Analysis & Specification
Software Engineering : Requirement Analysis & SpecificationSoftware Engineering : Requirement Analysis & Specification
Software Engineering : Requirement Analysis & Specification
Ajit Nayak
 
unit 5 Architectural design
 unit 5 Architectural design unit 5 Architectural design
unit 5 Architectural design
devika g
 
Software development process models
Software development process modelsSoftware development process models
Software development process models
Muhammed Afsal Villan
 
System Models in Software Engineering SE7
System Models in Software Engineering SE7System Models in Software Engineering SE7
System Models in Software Engineering SE7
koolkampus
 
unit 3 Design 1
unit 3 Design 1unit 3 Design 1
unit 3 Design 1
TharuniDiddekunta
 
Unit1
Unit1Unit1
Unit1
anuragmbst
 
Software maintenance Unit5
Software maintenance  Unit5Software maintenance  Unit5
Software maintenance Unit5
Mohammad Faizan
 
Design Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptxDesign Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptx
KarthigaiSelviS3
 
Unit 2(advanced class modeling & state diagram)
Unit  2(advanced class modeling & state diagram)Unit  2(advanced class modeling & state diagram)
Unit 2(advanced class modeling & state diagram)
Manoj Reddy
 
Data Designs (Software Engg.)
Data Designs (Software Engg.)Data Designs (Software Engg.)
Data Designs (Software Engg.)
Arun Shukla
 
Chapter 01 software engineering pressman
Chapter 01  software engineering pressmanChapter 01  software engineering pressman
Chapter 01 software engineering pressman
RohitGoyal183
 
Introduction to UML
Introduction to UMLIntroduction to UML

What's hot (20)

Coupling and cohesion
Coupling and cohesionCoupling and cohesion
Coupling and cohesion
 
Software design
Software designSoftware design
Software design
 
Software design
Software designSoftware design
Software design
 
Software Process Models
Software Process ModelsSoftware Process Models
Software Process Models
 
Software design
Software designSoftware design
Software design
 
Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modeling
 
Software Engineering - Ch1
Software Engineering - Ch1Software Engineering - Ch1
Software Engineering - Ch1
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategies
 
Software Engineering : Requirement Analysis & Specification
Software Engineering : Requirement Analysis & SpecificationSoftware Engineering : Requirement Analysis & Specification
Software Engineering : Requirement Analysis & Specification
 
unit 5 Architectural design
 unit 5 Architectural design unit 5 Architectural design
unit 5 Architectural design
 
Software development process models
Software development process modelsSoftware development process models
Software development process models
 
System Models in Software Engineering SE7
System Models in Software Engineering SE7System Models in Software Engineering SE7
System Models in Software Engineering SE7
 
unit 3 Design 1
unit 3 Design 1unit 3 Design 1
unit 3 Design 1
 
Unit1
Unit1Unit1
Unit1
 
Software maintenance Unit5
Software maintenance  Unit5Software maintenance  Unit5
Software maintenance Unit5
 
Design Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptxDesign Concepts in Software Engineering-1.pptx
Design Concepts in Software Engineering-1.pptx
 
Unit 2(advanced class modeling & state diagram)
Unit  2(advanced class modeling & state diagram)Unit  2(advanced class modeling & state diagram)
Unit 2(advanced class modeling & state diagram)
 
Data Designs (Software Engg.)
Data Designs (Software Engg.)Data Designs (Software Engg.)
Data Designs (Software Engg.)
 
Chapter 01 software engineering pressman
Chapter 01  software engineering pressmanChapter 01  software engineering pressman
Chapter 01 software engineering pressman
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 

Viewers also liked

08 component level_design
08 component level_design08 component level_design
Component level design
Component level designComponent level design
Component level design
Nadia Nahar
 
Slides chapter 11
Slides chapter 11Slides chapter 11
Slides chapter 11
Priyanka Shetty
 
SE_Component level design web based application
SE_Component level design web based application SE_Component level design web based application
SE_Component level design web based application
Samsuddoha Sams
 
Design concepts and principles
Design concepts and principlesDesign concepts and principles
Design concepts and principles
saurabhshertukde
 
Unit 5
Unit 5Unit 5
Unit 5
anuragmbst
 
05 architectural design
05 architectural design05 architectural design
User Interface Design
User Interface DesignUser Interface Design
User Interface Design
JReifman
 
USER INTERFACE DESIGN PPT
USER INTERFACE DESIGN PPTUSER INTERFACE DESIGN PPT
USER INTERFACE DESIGN PPT
vicci4041
 
Architecture design in software engineering
Architecture design in software engineeringArchitecture design in software engineering
Architecture design in software engineering
Preeti Mishra
 
Bellefort estates
Bellefort estatesBellefort estates
Pressman ch-11-component-level-design
Pressman ch-11-component-level-designPressman ch-11-component-level-design
Pressman ch-11-component-level-design
Oliver Cheng
 
Opinion pattern mining based on probabilistic principle component analysis re...
Opinion pattern mining based on probabilistic principle component analysis re...Opinion pattern mining based on probabilistic principle component analysis re...
Opinion pattern mining based on probabilistic principle component analysis re...
eSAT Journals
 
MKT526 FINAL FINAL (1)
MKT526 FINAL FINAL (1)MKT526 FINAL FINAL (1)
MKT526 FINAL FINAL (1)
GRACE(ZHENG) ZHONG
 
Statistics
Statistics Statistics
Statistics
D Dutta Roy
 
User interface design(sommerville) bangalore university
User interface design(sommerville) bangalore universityUser interface design(sommerville) bangalore university
User interface design(sommerville) bangalore university
Jaisha Shankar
 
Pca تجزیه و تحلیل مولفه های اساسی
Pca تجزیه و تحلیل مولفه های اساسیPca تجزیه و تحلیل مولفه های اساسی
Pca تجزیه و تحلیل مولفه های اساسی
Abolfazl Fatehi
 
Slides chapter 12
Slides chapter 12Slides chapter 12
Slides chapter 12
Priyanka Shetty
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented Principles
Emprovise
 
ICSME14 - On the Impact of Refactoring Operations on Code Quality Metrics
ICSME14 - On the Impact of Refactoring Operations on Code Quality MetricsICSME14 - On the Impact of Refactoring Operations on Code Quality Metrics
ICSME14 - On the Impact of Refactoring Operations on Code Quality Metrics
Oscar Chaparro
 

Viewers also liked (20)

08 component level_design
08 component level_design08 component level_design
08 component level_design
 
Component level design
Component level designComponent level design
Component level design
 
Slides chapter 11
Slides chapter 11Slides chapter 11
Slides chapter 11
 
SE_Component level design web based application
SE_Component level design web based application SE_Component level design web based application
SE_Component level design web based application
 
Design concepts and principles
Design concepts and principlesDesign concepts and principles
Design concepts and principles
 
Unit 5
Unit 5Unit 5
Unit 5
 
05 architectural design
05 architectural design05 architectural design
05 architectural design
 
User Interface Design
User Interface DesignUser Interface Design
User Interface Design
 
USER INTERFACE DESIGN PPT
USER INTERFACE DESIGN PPTUSER INTERFACE DESIGN PPT
USER INTERFACE DESIGN PPT
 
Architecture design in software engineering
Architecture design in software engineeringArchitecture design in software engineering
Architecture design in software engineering
 
Bellefort estates
Bellefort estatesBellefort estates
Bellefort estates
 
Pressman ch-11-component-level-design
Pressman ch-11-component-level-designPressman ch-11-component-level-design
Pressman ch-11-component-level-design
 
Opinion pattern mining based on probabilistic principle component analysis re...
Opinion pattern mining based on probabilistic principle component analysis re...Opinion pattern mining based on probabilistic principle component analysis re...
Opinion pattern mining based on probabilistic principle component analysis re...
 
MKT526 FINAL FINAL (1)
MKT526 FINAL FINAL (1)MKT526 FINAL FINAL (1)
MKT526 FINAL FINAL (1)
 
Statistics
Statistics Statistics
Statistics
 
User interface design(sommerville) bangalore university
User interface design(sommerville) bangalore universityUser interface design(sommerville) bangalore university
User interface design(sommerville) bangalore university
 
Pca تجزیه و تحلیل مولفه های اساسی
Pca تجزیه و تحلیل مولفه های اساسیPca تجزیه و تحلیل مولفه های اساسی
Pca تجزیه و تحلیل مولفه های اساسی
 
Slides chapter 12
Slides chapter 12Slides chapter 12
Slides chapter 12
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented Principles
 
ICSME14 - On the Impact of Refactoring Operations on Code Quality Metrics
ICSME14 - On the Impact of Refactoring Operations on Code Quality MetricsICSME14 - On the Impact of Refactoring Operations on Code Quality Metrics
ICSME14 - On the Impact of Refactoring Operations on Code Quality Metrics
 

Similar to Pressman ch-11-component-level-design

Seii unit7 component-level-design
Seii unit7 component-level-designSeii unit7 component-level-design
Seii unit7 component-level-design
Ahmad sohail Kakar
 
Ch 11-component-level-design
Ch 11-component-level-designCh 11-component-level-design
Ch 11-component-level-design
SHREEHARI WADAWADAGI
 
Software Design - SDLC Model
Software Design - SDLC ModelSoftware Design - SDLC Model
Software design, software engineering
Software design, software engineeringSoftware design, software engineering
Software design, software engineering
Rupesh Vaishnav
 
Architec design introduction
Architec design introductionArchitec design introduction
Architec design introduction
Dr.Jayanthi ramasamy
 
architectural design
 architectural design architectural design
architectural design
Preeti Mishra
 
Pressman_ch_9_design_engineering.ppt
Pressman_ch_9_design_engineering.pptPressman_ch_9_design_engineering.ppt
Pressman_ch_9_design_engineering.ppt
MotherTheresa2
 
Software Engineering Lec 8-design-
Software Engineering Lec 8-design-Software Engineering Lec 8-design-
Software Engineering Lec 8-design-
Taymoor Nazmy
 
Se ii unit3-architectural-design
Se ii unit3-architectural-designSe ii unit3-architectural-design
Se ii unit3-architectural-design
Ahmad sohail Kakar
 
Software Architecture
Software ArchitectureSoftware Architecture
Software Architecture
Ahmed Misbah
 
Function oriented design
Function oriented designFunction oriented design
Function oriented design
Vidhun T
 
Designing and documenting software architecture unit 5
Designing and documenting software architecture unit 5Designing and documenting software architecture unit 5
Designing and documenting software architecture unit 5
Sudarshan Dhondaley
 
Unit-III(Design).pptx
Unit-III(Design).pptxUnit-III(Design).pptx
Unit-III(Design).pptx
Fajar Baskoro
 
System design process.pptx
System design process.pptxSystem design process.pptx
System design process.pptx
NajibMuhammad16
 
Software Designing - Software Engineering
Software Designing - Software EngineeringSoftware Designing - Software Engineering
Software Designing - Software Engineering
Purvik Rana
 
Software Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptxSoftware Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptx
gauriVarshney8
 
session on pattern oriented software architecture
session on pattern oriented software architecturesession on pattern oriented software architecture
session on pattern oriented software architecture
SUJOY SETT
 
Unit 5 design engineering ssad
Unit 5 design engineering ssadUnit 5 design engineering ssad
Unit 5 design engineering ssad
Preeti Mishra
 
Software Engineering - SOFTWARE DESIGN Process
Software Engineering - SOFTWARE DESIGN ProcessSoftware Engineering - SOFTWARE DESIGN Process
Software Engineering - SOFTWARE DESIGN Process
Dr Anuranjan Misra
 
UNIT-4design-concepts-se-pressman-ppt.PPT
UNIT-4design-concepts-se-pressman-ppt.PPTUNIT-4design-concepts-se-pressman-ppt.PPT
UNIT-4design-concepts-se-pressman-ppt.PPT
malathijanapati1
 

Similar to Pressman ch-11-component-level-design (20)

Seii unit7 component-level-design
Seii unit7 component-level-designSeii unit7 component-level-design
Seii unit7 component-level-design
 
Ch 11-component-level-design
Ch 11-component-level-designCh 11-component-level-design
Ch 11-component-level-design
 
Software Design - SDLC Model
Software Design - SDLC ModelSoftware Design - SDLC Model
Software Design - SDLC Model
 
Software design, software engineering
Software design, software engineeringSoftware design, software engineering
Software design, software engineering
 
Architec design introduction
Architec design introductionArchitec design introduction
Architec design introduction
 
architectural design
 architectural design architectural design
architectural design
 
Pressman_ch_9_design_engineering.ppt
Pressman_ch_9_design_engineering.pptPressman_ch_9_design_engineering.ppt
Pressman_ch_9_design_engineering.ppt
 
Software Engineering Lec 8-design-
Software Engineering Lec 8-design-Software Engineering Lec 8-design-
Software Engineering Lec 8-design-
 
Se ii unit3-architectural-design
Se ii unit3-architectural-designSe ii unit3-architectural-design
Se ii unit3-architectural-design
 
Software Architecture
Software ArchitectureSoftware Architecture
Software Architecture
 
Function oriented design
Function oriented designFunction oriented design
Function oriented design
 
Designing and documenting software architecture unit 5
Designing and documenting software architecture unit 5Designing and documenting software architecture unit 5
Designing and documenting software architecture unit 5
 
Unit-III(Design).pptx
Unit-III(Design).pptxUnit-III(Design).pptx
Unit-III(Design).pptx
 
System design process.pptx
System design process.pptxSystem design process.pptx
System design process.pptx
 
Software Designing - Software Engineering
Software Designing - Software EngineeringSoftware Designing - Software Engineering
Software Designing - Software Engineering
 
Software Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptxSoftware Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptx
 
session on pattern oriented software architecture
session on pattern oriented software architecturesession on pattern oriented software architecture
session on pattern oriented software architecture
 
Unit 5 design engineering ssad
Unit 5 design engineering ssadUnit 5 design engineering ssad
Unit 5 design engineering ssad
 
Software Engineering - SOFTWARE DESIGN Process
Software Engineering - SOFTWARE DESIGN ProcessSoftware Engineering - SOFTWARE DESIGN Process
Software Engineering - SOFTWARE DESIGN Process
 
UNIT-4design-concepts-se-pressman-ppt.PPT
UNIT-4design-concepts-se-pressman-ppt.PPTUNIT-4design-concepts-se-pressman-ppt.PPT
UNIT-4design-concepts-se-pressman-ppt.PPT
 

Recently uploaded

managing Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptxmanaging Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptx
nabaegha
 
How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17
Celine George
 
Erasmus + DISSEMINATION ACTIVITIES Croatia
Erasmus + DISSEMINATION ACTIVITIES CroatiaErasmus + DISSEMINATION ACTIVITIES Croatia
Erasmus + DISSEMINATION ACTIVITIES Croatia
whatchangedhowreflec
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
Celine George
 
8+8+8 Rule Of Time Management For Better Productivity
8+8+8 Rule Of Time Management For Better Productivity8+8+8 Rule Of Time Management For Better Productivity
8+8+8 Rule Of Time Management For Better Productivity
RuchiRathor2
 
What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17
Celine George
 
Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024
khabri85
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Kalna College
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
Kalna College
 
How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...
Infosec
 
The Rise of the Digital Telecommunication Marketplace.pptx
The Rise of the Digital Telecommunication Marketplace.pptxThe Rise of the Digital Telecommunication Marketplace.pptx
The Rise of the Digital Telecommunication Marketplace.pptx
PriyaKumari928991
 
Diversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT KanpurDiversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT Kanpur
Quiz Club IIT Kanpur
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Celine George
 
Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024
Friends of African Village Libraries
 
Creating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptxCreating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptx
Forum of Blended Learning
 
Post init hook in the odoo 17 ERP Module
Post init hook in the  odoo 17 ERP ModulePost init hook in the  odoo 17 ERP Module
Post init hook in the odoo 17 ERP Module
Celine George
 
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
Nguyen Thanh Tu Collection
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
ShwetaGawande8
 
Talking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual AidsTalking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual Aids
MattVassar1
 
Science-9-Lesson-1-The Bohr Model-NLC.pptx pptx
Science-9-Lesson-1-The Bohr Model-NLC.pptx pptxScience-9-Lesson-1-The Bohr Model-NLC.pptx pptx
Science-9-Lesson-1-The Bohr Model-NLC.pptx pptx
Catherine Dela Cruz
 

Recently uploaded (20)

managing Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptxmanaging Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptx
 
How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17
 
Erasmus + DISSEMINATION ACTIVITIES Croatia
Erasmus + DISSEMINATION ACTIVITIES CroatiaErasmus + DISSEMINATION ACTIVITIES Croatia
Erasmus + DISSEMINATION ACTIVITIES Croatia
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
 
8+8+8 Rule Of Time Management For Better Productivity
8+8+8 Rule Of Time Management For Better Productivity8+8+8 Rule Of Time Management For Better Productivity
8+8+8 Rule Of Time Management For Better Productivity
 
What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17
 
Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
 
How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...
 
The Rise of the Digital Telecommunication Marketplace.pptx
The Rise of the Digital Telecommunication Marketplace.pptxThe Rise of the Digital Telecommunication Marketplace.pptx
The Rise of the Digital Telecommunication Marketplace.pptx
 
Diversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT KanpurDiversity Quiz Finals by Quiz Club, IIT Kanpur
Diversity Quiz Finals by Quiz Club, IIT Kanpur
 
Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17Creation or Update of a Mandatory Field is Not Set in Odoo 17
Creation or Update of a Mandatory Field is Not Set in Odoo 17
 
Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024
 
Creating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptxCreating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptx
 
Post init hook in the odoo 17 ERP Module
Post init hook in the  odoo 17 ERP ModulePost init hook in the  odoo 17 ERP Module
Post init hook in the odoo 17 ERP Module
 
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
 
Talking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual AidsTalking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual Aids
 
Science-9-Lesson-1-The Bohr Model-NLC.pptx pptx
Science-9-Lesson-1-The Bohr Model-NLC.pptx pptxScience-9-Lesson-1-The Bohr Model-NLC.pptx pptx
Science-9-Lesson-1-The Bohr Model-NLC.pptx pptx
 

Pressman ch-11-component-level-design

  • 1. Chapter 11 Component-Level Design - Introduction - The software component - Designing class-based components - Designing conventional components (Source: Pressman, R. Software Engineering: A Practitioner’s Approach. McGraw-Hill, 2005)
  • 3. Background • Component-level design occurs after the first iteration of the architectural design • It strives to create a design model from the analysis and architectural models – The translation can open the door to subtle errors that are difficult to find and correct later – “Effective programmers should not waste their time debugging – they should not introduce bugs to start with.” Edsgar Dijkstra • A component-level design can be represented using some intermediate representation (e.g. graphical, tabular, or text-based) that can be translated into source code • The design of data structures, interfaces, and algorithms should conform to well-established guidelines to help us avoid the introduction of errors 3
  • 5. Defined • A software component is a modular building block for computer software – It is a modular, deployable, and replaceable part of a system that encapsulates implementation and exposes a set of interfaces • A component communicates and collaborates with – Other components – Entities outside the boundaries of the system • Three different views of a component – An object-oriented view – A conventional view – A process-related view 5
  • 6. Object-oriented View • • A component is viewed as a set of one or more collaborating classes Each problem domain (i.e., analysis) class and infrastructure (i.e., design) class is elaborated to identify all attributes and operations that apply to its implementation – • • This also involves defining the interfaces that enable classes to communicate and collaborate This elaboration activity is applied to every component defined as part of the architectural design Once this is completed, the following steps are performed 1) 2) 3) 4) Provide further elaboration of each attribute, operation, and interface Specify the data structure appropriate for each attribute Design the algorithmic detail required to implement the processing logic associated with each operation Design the mechanisms required to implement the interface to include the messaging that occurs between objects 6
  • 7. Conventional View • A component is viewed as a functional element (i.e., a module) of a program that incorporates – The processing logic – The internal data structures that are required to implement the processing logic – An interface that enables the component to be invoked and data to be passed to it • A component serves one of the following roles – A control component that coordinates the invocation of all other problem domain components – A problem domain component that implements a complete or partial function that is required by the customer – An infrastructure component that is responsible for functions that support the processing required in the problem domain (More on next slide) 7
  • 8. Conventional View (continued) • Conventional software components are derived from the data flow diagrams (DFDs) in the analysis model – Each transform bubble (i.e., module) represented at the lowest levels of the DFD is mapped into a module hierarchy Control components reside near the top Problem domain components and infrastructure components migrate toward the bottom Functional independence is strived for between the transforms – – – • Once this is completed, the following steps are performed for each transform 1) 2) 3) Define the interface for the transform (the order, number and types of the parameters) Define the data structures used internally by the transform Design the algorithm used by the transform (using a stepwise refinement approach) 8
  • 9. Process-related View • Emphasis is placed on building systems from existing components maintained in a library rather than creating each component from scratch • As the software architecture is formulated, components are selected from the library and used to populate the architecture • Because the components in the library have been created with reuse in mind, each contains the following: – A complete description of their interface – The functions they perform – The communication and collaboration they require 9
  • 11. Component-level Design Principles • Open-closed principle – A module or component should be open for extension but closed for modification – The designer should specify the component in a way that allows it to be extended without the need to make internal code or design modifications to the existing parts of the component • Liskov substitution principle – Subclasses should be substitutable for their base classes – A component that uses a base class should continue to function properly if a subclass of the base class is passed to the component instead • Dependency inversion principle – Depend on abstractions (i.e., interfaces); do not depend on concretions – The more a component depends on other concrete components (rather than on the interfaces) the more difficult it will be to extend • Interface segregation principle – Many client-specific interfaces are better than one general purpose interface – For a server class, specialized interfaces should be created to serve major categories of clients – Only those operations that are relevant to a particular category of clients should be specified in the interface 11
  • 12. Component Packaging Principles • Release reuse equivalency principle – The granularity of reuse is the granularity of release – Group the reusable classes into packages that can be managed, upgraded, and controlled as newer versions are created • Common closure principle – Classes that change together belong together – Classes should be packaged cohesively; they should address the same functional or behavioral area on the assumption that if one class experiences a change then they all will experience a change • Common reuse principle – Classes that aren't reused together should not be grouped together – Classes that are grouped together may go through unnecessary integration and testing when they have experienced no changes but when other classes in the package have been upgraded 12
  • 13. Component-Level Design Guidelines • Components – Establish naming conventions for components that are specified as part of the architectural model and then refined and elaborated as part of the component-level model – Obtain architectural component names from the problem domain and ensure that they have meaning to all stakeholders who view the architectural model (e.g., Calculator) – Use infrastructure component names that reflect their implementationspecific meaning (e.g., Stack) • Dependencies and inheritance in UML – Model any dependencies from left to right and inheritance from top (base class) to bottom (derived classes) – Consider modeling any component dependencies as interfaces rather than representing them as a direct component-to-component dependency 13
  • 14. Cohesion • • Cohesion is the “single-mindedness’ of a component It implies that a component or class encapsulates only attributes and operations that are closely related to one another and to the class or component itself • The objective is to keep cohesion as high as possible • The kinds of cohesion can be ranked in order from highest (best) to lowest (worst) – Functional • A module performs one and only one computation and then returns a result – Layer • A higher layer component accesses the services of a lower layer component – Communicational • All operations that access the same data are defined within one class (More on next slide) 14
  • 15. Cohesion (continued) • Kinds of cohesion (continued) – Sequential • Components or operations are grouped in a manner that allows the first to provide input to the next and so on in order to implement a sequence of operations – Procedural • Components or operations are grouped in a manner that allows one to be invoked immediately after the preceding one was invoked, even when no data passed between them – Temporal • Operations are grouped to perform a specific behavior or establish a certain state such as program start-up or when an error is detected – Utility • Components, classes, or operations are grouped within the same category because of similar general functions but are otherwise unrelated to each other 15
  • 16. Coupling • As the amount of communication and collaboration increases between operations and classes, the complexity of the computer-based system also increases • As complexity rises, the difficulty of implementing, testing, and maintaining software also increases • Coupling is a qualitative measure of the degree to which operations and classes are connected to one another • The objective is to keep coupling as low as possible (More on next slide) 16
  • 17. Coupling (continued) • The kinds of coupling can be ranked in order from lowest (best) to highest (worst) – Data coupling • Operation A() passes one or more atomic data operands to operation B(); the less the number of operands, the lower the level of coupling – Stamp coupling • A whole data structure or class instantiation is passed as a parameter to an operation – Control coupling • Operation A() invokes operation B() and passes a control flag to B that directs logical flow within B() • Consequently, a change in B() can require a change to be made to the meaning of the control flag passed by A(), otherwise an error may result – Common coupling • A number of components all make use of a global variable, which can lead to uncontrolled error propagation and unforeseen side effects – Content coupling • One component secretly modifies data that is stored internally in another component (More on next slide) 17
  • 18. Coupling (continued) • Other kinds of coupling (unranked) – Subroutine call coupling • When one operation is invoked it invokes another operation within side of it – Type use coupling • Component A uses a data type defined in component B, such as for an instance variable or a local variable declaration • If/when the type definition changes, every component that declares a variable of that data type must also change – Inclusion or import coupling • Component A imports or includes the contents of component B – External coupling • A component communicates or collaborates with infrastructure components that are entities external to the software (e.g., operating system functions, database functions, networking functions) 18
  • 19. Conducting Component-Level Design 1) Identify all design classes that correspond to the problem domain as defined in the analysis model and architectural model Identify all design classes that correspond to the infrastructure domain 2) • • 1) These classes are usually not present in the analysis or architectural models These classes include GUI components, operating system components, data management components, networking components, etc. Elaborate all design classes that are not acquired as reusable components a) b) c) d) Specify message details (i.e., structure) when classes or components collaborate Identify appropriate interfaces (e.g., abstract classes) for each component Elaborate attributes and define data types and data structures required to implement them (usually in the planned implementation language) Describe processing flow within each operation in detail by means of pseudocode or UML activity diagrams (More on next slide) 19
  • 20. Conducting Component-Level Design (continued) 4) Describe persistent data sources (databases and files) and identify the classes required to manage them Develop and elaborate behavioral representations for a class or component 5) • 4) This can be done by elaborating the UML state diagrams created for the analysis model and by examining all use cases that are relevant to the design class Elaborate deployment diagrams to provide additional implementation detail • 4) Illustrate the location of key packages or classes of components in a system by using class instances and designating specific hardware and operating system environments Factor every component-level design representation and always consider alternatives • • Experienced designers consider all (or most) of the alternative design solutions before settling on the final design model The final decision can be made by using established design principles and guidelines 20
  • 22. Introduction • Conventional design constructs emphasize the maintainability of a functional/procedural program – Sequence, condition, and repetition • • Each construct has a predictable logical structure where control enters at the top and exits at the bottom, enabling a maintainer to easily follow the procedural flow Various notations depict the use of these constructs – Graphical design notation • Sequence, if-then-else, selection, repetition (see next slide) – Tabular design notation (see upcoming slide) – Program design language • Similar to a programming language; however, it uses narrative text embedded directly within the program statements 22
  • 24. Graphical Example used for Algorithm Analysis 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 while (x <= (y * y)) { if ((x % 11 == 0) && (x % y == 0)) { printf(“%d”, x); x++; } // End if else if ((x % 7 == 0) || (x % y == 1)) { printf(“%d”, y); x = x + 2; } // End else printf(“n”); } // End while 0 1 2 printf("End of listn"); return 0; } // End functionZ 3 int functionZ(int y) { int x = 0; 4 6 12 7 13 9 10 15 16 18 20 21 24
  • 25. Tabular Design Notation 1) 2) 3) 4) List all actions that can be associated with a specific procedure (or module) List all conditions (or decisions made) during execution of the procedure Associate specific sets of conditions with specific actions, eliminating impossible combinations of conditions; alternatively, develop every possible permutation of conditions Define rules by indicating what action(s) occurs for a set of conditions (More on next slide) 25
  • 26. Tabular Design Notation (continued) Rules Conditions 1 2 Condition A T T Condition B Condition C F 3 4 F T T T Actions Action X    Action Y Action Z   26  
  翻译: