Ch09 - Design Concepts-Combined
Ch09 - Design Concepts-Combined
Chapter 8
Requirements Modeling – A
Recommended Approach
© 2020 McGraw Hill. All rights reserved. Authorized only for instructor use in the classroom.
No reproduction or further distribution permitted without the prior written consent of McGraw Hill.
Requirements Analysis
Requirements analysis
• specifies software’s operational characteristics.
• indicates software's interface with other system elements.
• establishes constraints that software must meet.
© McGraw Hill 2
Requirements Models
• Scenario-based models depict requirements from the point of
view of various system “actors.”
• Class-oriented models represent object-oriented classes
(attributes and operations) and how classes collaborate to
achieve system requirements.
• Behavioral models depict how the software reacts to internal
or external “events.”
• Data models depict the information domain for the problem.
• Flow-oriented models represent functional elements of the
system and how they transform data in the system.
© McGraw Hill 3
A Bridge
© McGraw Hill 4
Rules of Thumb
• The level of abstraction should be relatively high - focus on
requirements visible in problem or business domains.
• Analysis model should provide insight into information
domain, function, and behavior of the software.
• Delay consideration of infrastructure and other non-functional
models until later in the modeling activity.
• The analysis model provides value to all stakeholders keep the
model as simple as it can be.
© McGraw Hill 5
Requirements Modeling Principles
• Principle 1. The information domain of a problem must be
represented and understood.
The information domain encompasses the data that flow into the system
(from end users, other systems, or external devices), the data that flow out of
the system (via the user interface, network interfaces, reports, graphics, and
other means), and the data stores that collect and organize the data that are
maintained permanently.
© McGraw Hill 7
Scenario-Based Modeling: Actors and
Profiles
A UML actor models an entity that interacts with a system object.
• Actors may represent roles played by human stakeholders or external
hardware as they interact with system objects by exchanging information.
© McGraw Hill 8
Use Cases
• Developers need more precise means of describing this
interaction before beginning to create the software
• Use case as a “contract for behavior” and more formal than a
user story.
• Use-cases are simply an aid to defining what exists outside the
system (actors) and what should be performed by the system
(use-cases).
1. What should we write about?
2. How much should we write about it?
3. How detailed should we make our description?
4. How should we organize the description?
© McGraw Hill 9
What to Write About?
• The first two requirements engineering tasks—inception and
elicitation—provide you with the information you’ll need to
begin writing use cases.
• To begin developing a set of use cases, list the functions or
activities performed by a specific actor.
• You can obtain these from a list of required system functions,
through conversations with stakeholders, or by an evaluation of
activity diagrams developed as part of requirements modeling.
• Use cases of this type are sometimes referred to as primary
scenarios.
© McGraw Hill 10
Alternative Interactions
Description of alternative interactions is essential to completely
understand a function described a use case.
• Can the actor take some other action at this point?
• Is it possible that the actor will encounter some error condition at this point?
• Is it possible that the actor will encounter some other behavior at this point
(for example: behavior that is invoked by some event outside the actor’s
control)?
© McGraw Hill 11
Defining Exceptions
An exception describes a situation (either a failure condition or
an alternative chosen by the actor) that causes the system to
exhibit somewhat different behavior.
Questions to ask:
• Are there cases in which some “validation function” occurs during this use
case?
• Are there cases in which a supporting function (or actor) will fail to
respond appropriately?
• Can poor system performance result in unexpected or improper user
actions?
© McGraw Hill 12
Documenting Use Cases
• What are the main tasks or functions that are performed by the
actor?
• What system information will the actor acquire, produce or
change?
• Will the actor have to inform the system about changes in the
external environment?
• What information does the actor desire from the system?
• Does the actor wish to be informed about unexpected changes?
• What are the preconditions, triggers, exceptions, and open
issues?
© McGraw Hill 13
Use Case Diagram
© McGraw Hill 14
Use Case Diagram
● Each modeling notation has limitations, and the UML use case
is no exception. Like any other form of written description, a
use case is only as good as its author(s).
● If the description is unclear, the use case can be misleading or
ambiguous.
● It focuses on function and behavioral requirements and is
generally inappropriate for nonfunctional requirements.
● For situations in which the requirements model must have
significant detail and precision (e.g., safety critical systems), a
use case may not be sufficient
© McGraw Hill 15
Class-Based Modeling
Class-based modeling represents:
• objects that the system will manipulate.
• operations (also called methods or services) that will be applied to the objects
to effect the manipulation.
• relationships (some hierarchical) between the objects.
• collaborations that occur between the classes that are defined.
© McGraw Hill 16
Identifying Analysis Classes
Examining the usage scenarios developed as part of the
requirements model and perform a "grammatical parse“.
• Classes are determined by underlining each noun or noun phrase and entering
it into a simple table.
• Synonyms should be noted.
• If the class (noun) is required to implement a solution, then it is part of the
solution space; otherwise, if a class is necessary only to describe a solution, it
is part of the problem space.
But what should we look for once all of the nouns have been
isolated?
© McGraw Hill 17
Potential Analysis Classes
• External entities (for example: other systems, devices, people) that produce
or consume information.
• Things (for example: reports, displays, letters, signals) that are part of the
information domain for the problem.
• Occurrences or events that occur within the context of system operation.
• Roles played by people who interact with the system.
• Organizational units that are relevant to an application.
• Places that establish the context of the problem and overall function.
• Structures (for example: sensors, four-wheeled vehicles, or computers) that
define a class of objects or related classes of objects.
© McGraw Hill 18
Analysis Class Selection
• Retained information. Potential class will be useful during analysis only if
information about it must be remembered.
• Needed services. Potential class must have a set of identifiable operations
that can change the value of its attributes in some way.
• Multiple attributes. Focus should be on "major" information; a class with a
single attribute may be better represented as an attribute of another class.
• Common attributes. A set of attributes can be defined for the potential class
and the attributes apply to all instances of the class.
• Common operations. A set of operations can be defined for the potential
class and the operations apply to all instances of the class.
• Essential requirements. External entities that appear in the problem space
and produce or consume information essential to the solution will usually be
defined as analysis classes in the model.
© McGraw Hill 19
Defining Attributes
• Attributes describe a class that has been selected for inclusion
in the analysis model.
• It is the attributes that define the class—that clarify what is
meant by the class in the context of the problem space.
• To develop a meaningful set of attributes for an analysis class,
you should study each use case and select those “things” that
reasonably “belong” to the class.
• What data items(composite and/or elementary) fully define this
class in the context of the problem at hand?
© McGraw Hill 20
Defining Operations
• Operations define the behavior of an object.
• Operations they can generally be divided into four broad categories:
1. Operations that manipulate data in some way.
2. Operations that perform a computation.
3. Operations that inquire about the state.
4. Operations that monitor an object for the occurrence of a controlling
event.
• These functions are accomplished by operating on attributes and/or
associations.
• Therefore, an operation must have “knowledge” of the class attributes and
associations.
© McGraw Hill 21
CRC Modeling
• Class-responsibility-collaborator (CRC) modeling provides a
simple means for identifying and organizing the classes that are
relevant to system or product requirements.
• A CRC model is really a collection of standard index cards that
represent classes.
• The cards are divided into three sections:
1. Along the top of the card you write the name of the class.
2. list the class responsibilities on the left.
3. list the collaborators on the right.
© McGraw Hill 22
CRC Cards
© McGraw Hill 23
CRC Model Review Process
1. All stakeholders in the review (of the CRC model) are given a subset of
the CRC model index cards. No reviewer should have two cards that
collaborate.
2. The review leader reads the use case deliberately. As the review leader
comes to a named object, she passes a token to the person holding the
corresponding class index card.
3. When the token is passed, the holder of the class card is asked to describe
the responsibilities noted on the card. The group determines whether one
of the responsibilities satisfies the use case requirement.
4. If an error is found, modifications are made to the cards. This may include
the definition of new classes (CRC index cards) or revising lists of
responsibilities or collaborations on existing cards.
© McGraw Hill 24
Functional Modeling
• The functional model addresses two application processing
elements:
1. user-observable functionality that is delivered by the app to
end users.
2. operations contained within analysis classes that implement
behaviors associated with the class.
• UML activity diagrams can be used to represent processing
details.
• UML activity diagram supplements a use case by providing a
graphical representation of the flow of interaction within a
specific scenario.
© McGraw Hill 25
Activity Diagram 1
© McGraw Hill 26
Activity Diagram 1
© McGraw Hill 27
Sequence Diagram 1
© McGraw Hill 28
Sequence Diagram 2
© McGraw Hill 29
Behavioral Modeling
• A behavioral model indicates how software will respond to
internal or external events or stimuli.
• This information is useful in the creation of an effective design
for the system to be built.
• UML activity diagrams can be used to model how system
elements respond to internal events.
• UML state diagrams can be used to model how system
elements respond to external events.
© McGraw Hill 30
Creating Behavioral Models
1. Evaluate all use cases to fully understand the sequence of
interaction within the system.
2. Identify events that drive the interaction sequence and
understand how these events relate to specific objects.
3. Create a sequence diagram for each use case.
4. Build a state diagram for the system.
5. Review the behavioral model for accuracy and consistency.
© McGraw Hill 31
Identifying Events
• A use case represents a sequence of activities that involves
actors and the system.
• An event occurs whenever the system and an actor exchange
information.
• An event is not the information that has been exchanged, but
rather the fact that information has been exchanged.
• A use case needs to be examined for points of information
exchange.
• Events are used to trigger state transitions.
© McGraw Hill 32
State Diagram
© McGraw Hill 33
State Diagram
● An action occurs concurrently with the state transition or
because of it and generally involves one or more operations
(responsibilities) of the object.
● For example, the action connected to the password entered
event is an operation named validatePassword() that accesses a
password object and performs a digit-by-digit comparison to
validate the entered password.
© McGraw Hill 34
Activity Diagram 2
© McGraw Hill 35
Swimlane Diagrams
• The UML swimlane diagram is a useful variation of the
activity diagram that allows you to represent the flow of
activities described by the use case.
• Swimlane diagrams indicate which actor (if there are multiple
actors involved in a specific use case) or analysis class has
responsibility for the action described by an activity rectangle.
• Responsibilities are represented as parallel segments that
divide the diagram vertically, like the lanes in a swimming
pool.
© McGraw Hill 36
Swimlane Diagram
© McGraw Hill 37
Swimlane Diagram
● The activity diagram is rearranged so that activities associated
with an analysis class fall inside the swimlane for that class.
● For example, the Interface class represents the user interface as
seen by the homeowner.
● Use cases, along with the activity and swimlane diagrams, are
procedurally oriented.
● Taken together they can be used to represent the way various
actors invoke specific functions (or other procedural steps) to
meet the requirements of the system.
© McGraw Hill 38
Summary
● The objective of requirements modeling is to create a variety of
representations that describe what the customer requires, establish a
basis for the creation of a software design, and define a set of
requirements that can be validated once the software is built.
● The requirements model bridges the gap between a system-level
description that describes overall system and business functionality and a
software design.
● Scenario-based models depict software requirements from the user’s
point of view.
● Class-based modeling uses information derived from use cases and other
written application descriptions to identify analysis classes.
● A set of class-responsibility-collaborator index cards can be used to
define relationships between classes.
● Behavioral modeling during requirements analysis depicts dynamic
behavior of the software.
© McGraw Hill 39
Because learning changes everything. ®
www.mheducation.com
© 2020 McGraw Hill. All rights reserved. Authorized only for instructor use in the classroom.
No reproduction or further distribution permitted without the prior written consent of McGraw Hill.
Accessibility Content: Text Alternatives for Images
© McGraw Hill 41
A Bridge – Text Alternative
Return to parent-slide containing images.
An illustration displays CRC cards. The title reads class: floor plan.
The space below the title reads description. The card is further
divided into two columns titled responsibility, and collaborator. The
responsibility reads defines floor plan name or type; manages floor
plan positioning; scales floor plan for display; incorporates walls,
door, and windows, and shows position of video cameras. The
collaborator reads, wall on the column corresponding to
incorporates wall, doors, and windows; and camera in the column
respective to shows position of video cameras.
The sequence diagram has four life lines which are labeled, from left to
right, homeowner, control panel, system and sensors. When the system is
ready the homeowner enters a password which is relayed to the control
panel. The control panel begins by reading the message and then
performs a compare of the password entered. When comparing the
control panel sends a lookup request to the system which return a result.
If the password is correct the system sends an activation request to the
sensors which over a duration sends a successful activation message to
the control panel which further the relays the successful activation
message to the homeowner. If the password entered is wrong the
homeowner has a maximum number of three tries to enter the correct
password. If the three tries are exceeded the system is locked. Locked
system has looped timer.
The state diagram shows an initial state of the process. After the key is hit
the diagram shows a reading state. The reading state transitions the
entered password to a comparing state. The comparing state is a shown as
a class with a validate password operation. The comparing state has a
loop, if password equals incorrect and number of tries greater than
maximum number of tries. When number of tries exceeds maximum
number of tries the comparing state transitions to a locked state. A locked
state has a loop with timer greater than locked time. When timer greater
than locked time the locked state transitions back to the reading state. If
the password entered is correct the comparing state transitions to a
selecting state. Upon a successful activation selecting state transitions
back to the reading state.
The activity diagram begins with an initial state. The next activity state is enter
password and user ID. This initiates a condition. If a password and ID are valid
and if a password and ID are invalid. If invalid, then prompt for reentry activity.
This entails another condition. If input tries remain the process loops back to the
initial condition at enter password and ID if no input tries remain the process
reaches an end state. If in the initial condition the valid ID and password were
entered the next activity is select major function here other functions may also be
selected. After this next activity is select surveillance. After selecting
surveillance, the user can choose thumbnail views or select a specific camera.
Selecting thumbnail, leads to select specific camera thumbnails and selecting a
specific camera leads to select camera icon. Both, select specific camera
thumbnails and select camera icon lead to view camera in output in labeled
window. This leads to prompt for another view. This leads to two condition. First
exit this function which leads to a final state or see another camera which loops
back to the condition under select surveillance.
The swimlane diagram is illustrated within a table. The three column headings of the table
are: homeowner, camera and interface. The flow begins with an initial state in
homeowner. The next activity state is enter password and user I D. This initiates a
condition in the interface. If a password and ID are valid and if a password and ID are
invalid. If invalid, then prompt for reentry activity. This entails another condition also
within interface. If input tries remain the process loops back to the initial condition at
enter password and ID if no input tries remain the process reaches an end state. If in the
initial condition the valid ID and password were entered the next activity is select major
function, under homeowner, here other functions may also be selected. After this next
activity is select surveillance. After selecting surveillance, the user can choose thumbnail
views or select a specific camera. Selecting thumbnail, leads to select specific camera
thumbnails and selecting a specific camera leads to select camera icon. Both, select
specific camera thumbnails and select camera icon lead to, the activity, generate video
output, under the column camera. Generate video output leads to view camera in output in
labeled window, under homeowner. This leads to prompt for another view under interface.
This leads to two conditions. First exit this function which leads to a final state or see
another camera which loops back to the condition under select surveillance.
Chapter 9
Design Concepts
© 2020 McGraw Hill. All rights reserved. Authorized only for instructor use in the classroom.
No reproduction or further distribution permitted without the prior written consent of McGraw Hill.
Design
● Design is pivotal to successful software engineering.
● Some developers are tempted to begin programming once the
use cases have been created, without regard to how the software
components needed to implement the use cases relate to one
another
● It is possible to do analysis, design, and implementation
iteratively by creating several software increments.
© McGraw Hill 2
Software Design
• Encompasses the set of principles, concepts, and practices that
lead to the development of a high quality system or product.
• Design principles establish and overriding philosophy that guides
the designer as the work is performed.
• Design concepts must be understood before the mechanics of
design practice are applied.
• Software design practices change continuously as new methods,
better analysis, and broader understanding evolve.
© McGraw Hill 3
Software Engineering Design
• Data/Class design – transforms analysis classes into
implementation classes and data structures.
• Architectural design – defines relationships among the major
software structural elements.
• Interface design – defines how software elements, hardware
elements, and end-users communicate.
• Component-level design – transforms structural elements into
procedural descriptions of software components.
© McGraw Hill 4
Mapping Requirements Model to
Design Model
© McGraw Hill 5
Design and Quality
● The importance of software design can be stated with a single
word—quality.
● It is a place where quality is fostered in software engineering.
● Provides representation of software that can be assessed for
quality.
● Design is the only way that you can accurately translate
stakeholders’ requirements into a finished software product or
system.
● Software design serves as the foundation for all the software
engineering and software support activities that follow.
● Without design, you risk building an unstable system.
© McGraw Hill 6
Design and Quality
• The design must implement all of the explicit requirements
contained in the analysis model, and it must accommodate all of
the implicit requirements desired by the customer.
• The design should be a readable, understandable guide for those
who generate code and for those who test and subsequently
support the software.
• The design should provide a complete picture of the software,
addressing the data, functional, and behavioral domains from an
implementation perspective.
© McGraw Hill 7
Quality Guidelines
1. A design should exhibit an architecture (a) created using recognizable
architectural styles or patterns, (b) composed of well designed components
(c) implemented in an evolutionary fashion.
2. A design should be modular.
3. A design should contain distinct representations of data, architecture,
interfaces, and components.
4. A design should lead to data structures that are drawn from recognizable data
patterns.
5. A design should contain functionally independent components.
6. A design should lead to interfaces that reduce the complexity of connections
between components and the external environment.
7. A design should be derived using a repeatable method that is driven by
software requirements analysis.
8. A design should be represented using meaningful notation.
© McGraw Hill 8
Common Design Characteristics
Each new software design methodology introduces unique
heuristics and notions – yet they each contain:
1. A mechanism for the translating the requirements model into a
design representation.
2. A notation for representing functional components and their
interfaces.
3. Heuristics for refinement and partitioning.
4. Guidelines for quality assessment.
© McGraw Hill 9
Design Concepts 1
© McGraw Hill 10
Design Concepts 2
© McGraw Hill 11
Modularity and Software Cost
© McGraw Hill 12
Design Concepts 3
© McGraw Hill 13
Design Concepts 4
© McGraw Hill 14
Design Class Example
© McGraw Hill 15
Design Class Characteristics
• Complete - includes all necessary attributes and methods) and
sufficient (contains only those methods needed to achieve class
intent).
• Primitiveness – each class method focuses on providing one
service. Once the service has been implemented with a method,
the class should not provide another way to accomplish the same
thing.
• High cohesion – small, focused, single-minded classes.
• Low coupling – class collaboration kept to minimum.If a design
model is highly coupled (all design classes collaborate with all
other design classes), the system is difficult to implement, to test,
and to maintain over time.
© McGraw Hill 16
Information Hiding
• Reduces the likelihood of “side effects.”
• Limits the global impact of local design decisions.
• Emphasizes communication through controlled interfaces.
• Discourages the use of global data.
• Leads to encapsulation—an attribute of high quality design.
• Results in higher quality software.
© McGraw Hill 17
Architecture Properties
• Structural properties. This aspect of the architectural design
representation defines the components of a system (for example,
modules, objects, filters) and the manner in 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 characteristics.
• Families of related systems. The architectural design should
draw upon repeatable patterns (building blocks) often
encountered in the design of similar systems.
© McGraw Hill 18
Design Pattern Template
Pattern name - describes the essence of the pattern in a short but expressive name
Structure - describes the classes that are required to implement the pattern
Participants - describes the responsibilities of the classes that are required to implement the pattern
Collaborations - describes how the participants collaborate to carry out their responsibilities
Consequences - describes the “design forces” that affect the pattern and the potential trade-offs that
must be considered when the pattern is implemented
© McGraw Hill 19
Design Model
© McGraw Hill 20
Design Modeling Principles 1
© McGraw Hill 21
Design Modeling Principles 2
© McGraw Hill 22
Data Design Elements
Data model – data objects and database architectures.
• Examines data objects independently of processing.
• Focuses attention on the data domain.
• Creates a model at the customer’s level of abstraction.
• Indicates how data objects relate to one another.
© McGraw Hill 23
Architectural Design Elements
Architectural design for software - equivalent to the floor plan for a
house.
The architectural model is derived from three sources:
• Information about the application domain for the software to be built.
• Specific requirements model elements such as data flow analysis classes and
their relationships (collaborations) for the problem at hand, and
• Availability of architectural patterns and styles.
© McGraw Hill 24
Interface Design Elements
Interface is a set of operations that describes the externally
observable behavior of a class and provides access to its public
operations.
Important elements:
• User interface (UI).
• External interfaces to other systems.
• Internal interfaces between various design components.
© McGraw Hill 25
Interface Model for Control Panel
© McGraw Hill 26
Component-Level Design Elements
Describes the internal detail of each software component.
Defines:
• Data structures for all local data objects.
• Algorithmic detail for all component processing functions.
• Interface that allows access to all component operations.
© McGraw Hill 27
Deployment Design Elements
Indicates how software functionality and subsystems will be
allocated within the physical computing environment.
Modeled using UML deployment diagrams.
• Descriptor form deployment diagrams - show the computing environment but
does not indicate configuration details.
• Instance form deployment diagrams - identify specific hardware
configurations and are developed in the latter stages of design.
© McGraw Hill 28
UML Deployment Instance Diagram
© McGraw Hill 29
Because learning changes everything. ®
www.mheducation.com
© 2020 McGraw-Hill Education. All rights reserved. Authorized only for instructor use in the classroom.
No reproduction or further distribution permitted without the prior written consent of McGraw-Hill Education.
Accessibility Content: Text Alternatives for Images
© McGraw Hill 31
Mapping Requirements Model to
Design Model – Text Alternative
Return to parent-slide containing images.
A graph plots cost of effort versus number of modules. The plotted graph has
three curves labeled: total software cost, cost to integrate, and cost per module.
The curve for cost to ingrate rises from the origin and approaches a hypothetical
vertical asymptote. The cost per module curve falls from the positive y axis
approaching the positive x axis. The x axis acts as the horizontal asymptote for
the curve. The curve for total software cost falls and rises between the upper
intersection of the two curves: cost per module and cost to integrate. A region
label M is the region of minimum cost and comprises of the region contained
between two dotted vertical lines which are plotted on either sides of the two
intersecting curves.
The diagram shows a design class example. The various class names in the
diagram are as follow: wall segment, window, segment, floorplan and camera.
The attributes and operation for each class are as follow. Segment, attributes are:
start coordinate and end coordinate. The operations are: get type and draw.
Floorplan attributes are: type and outside dimension. The operations are: add
camera, add wall, add window delete segment and draw. Camera, attributes are:
type, ID, field view, pan angle and zoom setting. The relationship in the class
diagram is as follow: segment has an inheritance relationship with wall segment
and window. Floorplan has an aggregation relationship with segment with
exactly one cardinality. Floorplan has one to many association with camera.
The design model is explained in a graphical representation. The y axis plots abstraction dimension
which range from low to high. The design model is plotted in the low region and analysis model is
plotted in the high region. The x axis plots process dimension for architecture elements, interface
elements, component level elements and deployment level elements. For architecture elements the flow
from high to low is as follows. In the high range under the analysis model the components are: class
diagrams, analysis packages, CRC models, collaboration diagrams and processing narratives. Between
high and low for analysis model the components are: design class realization, subsystems, and
collaboration diagrams. The low components under design model are: refinements to design class
realizations, subsystems and collaboration diagrams. For interface elements only the components under
the analysis model are used. The components ranging from high to low are: uses cases-text, use case
diagrams, swimlane diagrams, processing narratives, state diagrams, and sequence diagrams. The
mid-range components are: technical interface design, navigation design and GUI design. For
component level elements, under the analysis model, the components ranging from high to low are:
Class diagrams, analysis packages, CRC models, collaboration diagrams, processing narratives, state
diagrams, and sequence diagrams. The mid-range components are: components diagrams, design classes,
activity diagrams, and sequence diagrams. The low components under design model are: refinements to
component diagrams, design classes, activity diagrams, and sequence diagrams. For deployment level
elements, under the analysis model, the requirements ranging from high to low are: constraints,
interoperability and targets and configuration. The low components under design model are: design class
realizations, subsystems, collaboration diagrams, design classes, activity diagrams, and sequence
diagrams. This leads to the deployment diagrams.
Chapter 10
Architectural Design – A
Recommended Approach
© 2020 McGraw Hill. All rights reserved. Authorized only for instructor use in the classroom.
No reproduction or further distribution permitted without the prior written consent of McGraw Hill.
What is Software Architecture?
The architecture is not the operational software, it is a
representation that enables a software engineer to:
1. Analyze the effectiveness of the design in meeting its stated
requirements,
2. Consider architectural alternatives at a stage when making
design changes is still relatively easy, and
3. Reduce the risks associated with the construction of the
software.
© McGraw Hill 2
Why is Software Architecture
Important?
• Software architecture provides a representation that facilitates
communication among all stakeholders interested in the
development of a computer-based system.
• Architecture highlights early design decisions that will have a
profound impact on all software engineering work that follows.
• Architecture constitutes a relatively small, intellectually
graspable mode of how the system is structured and how its
components work together.
© McGraw Hill 3
Architectural Descriptions
The IEEE Computer Society has proposed IEEE-Std-42010-2011, Systems and
Software Engineering – Architecture Description.
Describes the use of architecture viewpoints, architecture frameworks, and architecture
description languages as a means of codifying the conventions and common practices
for architectural description.
© McGraw Hill 4
Architecture Decision Documentation
1. Determine information items needed for each decision.
2. Define links between each decision and appropriate
requirements.
3. Provide mechanisms to change status when alternative decisions
need to be evaluated.
4. Define prerequisite relationships among decisions to support
traceability.
5. Link significant decisions to architectural views resulting from
decisions.
6. Document and communicate all decisions as they are made.
© McGraw Hill 5
Agility and Architecture
• To avoid rework, user stories are used to create and evolve an
architectural model (walking skeleton) before beginning any
coding.
• Use models which allow software architects to add user stories to
the evolving storyboard and works with the product owner to
prioritize the architectural stories as “sprints” (work units) are
planned.
• Well-run agile projects include delivery of architectural
documentation during each sprint.
• After the sprint is completed, the architect reviews the working
prototype for quality before the team presents it to the
stakeholders in a formal sprint review.
© McGraw Hill 6
Architectural Styles
Each style describes a system category that encompasses:
1. set of components (for example: a database, computational
modules) that perform a function required by a system.
2. set of connectors that enable “communication, coordination
and cooperation” among components.
3. constraints that define how components can be integrated to
form the system.
4. semantic models that enable a designer to understand the
overall properties of a system by analyzing the known
properties of its constituent parts.
© McGraw Hill 7
Data Centered Architecture
© McGraw Hill 8
Data Centered Architecture
● A data store resides at the centre of architecture and is accessed
by other components that update, add, delete or otherwise
modify data within store.
● Client software accesses a central repository.
● In some cases, the data repository is passive. That is, client
software accesses the data independent of any changes to the
data or the actions of other client software.
● Data-centered architectures promote integrability .That is,
existing components can be changed and new client
components added to the architecture without concern about
other clients
© McGraw Hill 9
Data Flow Architecture
© McGraw Hill 10
Data Flow Architecture
● This architecture is applied when input data are to be
transformed through a series of computational or manipulative
components into output data.
● A pipe-and-filter pattern has a set of components, called filters,
connected by pipes that transmit data from one component to
the next. Each filter works independently of those components
upstream and downstream.
● However, the filter does not require knowledge of the workings
of its neighboring filters.
© McGraw Hill 11
Call-and-Return Architecture
© McGraw Hill 12
Call-and-Return Architecture
● This architectural style enables you to achieve a program
structure that is relatively easy to modify and scale.
○ Main program/subprogram architectures. This classic
program structure decomposes function into a control
hierarchy where a “main” program invokes several program
components, which in turn may invoke still other
components.
○ Remote procedure call architectures. The components of a
main program/ subprogram architecture are distributed
across multiple computers on a network.
© McGraw Hill 13
Object-Oriented Architecture
© McGraw Hill 14
Object-Oriented Architecture
● The components of a system encapsulate data and the
operations that must be applied to manipulate the data.
● Communication and coordination between components are
accomplished via message passing.
● Contains a UML communication diagram that shows the
message passing for the login portion of a system implemented
using an object-oriented architecture.
© McGraw Hill 15
Layered Architecture
© McGraw Hill 16
Layered Architecture
● A number of different layers are defined, each accomplishing
operations that progressively become closer to the machine
instruction set.
● At the outer layer, components service user interface
operations.
● At the inner layer, components perform operating system
interfacing.
● Intermediate layers provide utility services and application
software functions.
© McGraw Hill 17
Model View Controller Architecture
© McGraw Hill 18
Model View Controller Architecture
● MVC suggested mobile infrastructure models often used in
Web development.
● The model contains all application-specific content and
processing logic.
● The view contains all interface-specific functions and enables
the presentation of content and processing logic required by the
end user.
● The controller manages access to the model and the view and
coordinates the flow of data between them.
● User requests are handled by the controller. The controller also
selects the view object that is applicable based on the user
request. Once the type of request is determined, a behavior
request is transmitted to the model, which implements the
functionality or retrieves the content required to accommodate
the request.
© McGraw Hill 19
Architectural Organization and
Refinement 1
Control.
• How is control managed within the architecture?
• Does a distinct control hierarchy exist, and if so, what is the role
of components within this control hierarchy?
• How do components transfer control within the system?
• How is control shared among components?
• What is the control topology (that is, the geometric form that the
control takes)?
• Is control synchronized, or do components operate
asynchronously?
© McGraw Hill 20
Architectural Organization and
Refinement 2
Data.
• How are data communicated between components?
• Is the flow of data continuous, or are data objects passed to the
system sporadically?
• What is the mode of data transfer?
• Do data components exist, and if so, what is their role?
• How do functional components interact with data components?
• Are data components passive or active?
• How do data and control interact within the system?
© McGraw Hill 21
Architectural Considerations
• Economy – software is uncluttered and relies on abstraction to
reduce unnecessary detail.
• Visibility – Architectural decisions and their justifications should
be obvious to software engineers who review.
• Spacing – Separation of concerns in a design without
introducing hidden dependencies.
• Symmetry – Architectural symmetry implies that a system is
consistent and balanced in its attributes.
• Emergence – Emergent, self-organized behavior and control are
key to creating scalable, efficient, and economic software
architectures.
© McGraw Hill 22
Architectural Design
The software must be placed into context.
• The design should define the external entities (other systems, devices,
people) that the software interacts with and the nature of the
interaction.
A set of architectural archetypes should be identified.
• An archetype is an abstraction (similar to a class) that represents one
element of system behavior.
The designer specifies the structure of the system by defining and
refining software components that implement each archetype.
© McGraw Hill 23
Architecture Context Diagram
© McGraw Hill 24
Architecture Context Diagram
● The overall SafeHome product controller and the Internet-based
system are both superordinate to the security function and are
shown above the function.
● The surveillance function is a peer system and uses (is used by)
the home security function in later versions of the product.
● The homeowner and control panels are actors that produce and
consume information that is, respectively, used and produced
by the security software.
● Finally, sensors are used by the security software and are shown
as subordinate to it
© McGraw Hill 25
SafeHome Security Function Archetype
© McGraw Hill 26
SafeHome Top-Level Component
Architecture
© McGraw Hill 27
SafeHome Refined Component
Architecture
© McGraw Hill 28
Architectural Tradeoff Analysis
1. Collect scenarios.
2. Elicit requirements, constraints, environment description.
3. Describe the architectural styles/patterns that have been chosen
to address the scenarios and requirements using one of these
views: module, process, data flow.
4. Evaluate quality attributes by considering each one in isolation.
5. Identify the sensitivity of quality attributes to various
architectural attributes for a specific architectural style.
6. Critique candidate architectures (developed in step 3) using the
sensitivity analysis (conducted in step 5).
© McGraw Hill 29
Architectural Reviews
• Assess the ability of the software architecture to meet the
systems quality requirements and identify potential risks.
© McGraw Hill 30
Pattern-based Architectural Reviews
1. Identify and discuss the quality attributes by walking through
the use cases.
2. Discuss a diagram of system’s architecture in relation to its
requirements.
3. Identify the architecture patterns used and match the system’s
structure to the patterns’ structure.
4. Use existing documentation and use cases to determine each
pattern’s effect on quality attributes.
5. Identify all quality issues raised by architecture patterns used in
the design.
6. Develop a short summary of issues uncovered during the
meeting and make revisions to the walking skeleton.
© McGraw Hill 31
Because learning changes everything. ®
www.mheducation.com
© 2020 McGraw-Hill Education. All rights reserved. Authorized only for instructor use in the classroom.
No reproduction or further distribution permitted without the prior written consent of McGraw-Hill Education.
Accessibility Content: Text Alternatives for Images
© McGraw Hill 33
Data Centered Architecture – Text Alternative
Return to parent-slide containing images.
Chapter 11
Component-Level Design
© 2020 McGraw Hill. All rights reserved. Authorized only for instructor use in the classroom.
No reproduction or further distribution permitted without the prior written consent of McGraw Hill.
What is a component? 1
© McGraw Hill 2
What is a component? 2
© McGraw Hill 3
Class-based Component-Level Design
© McGraw Hill 4
Traditional Component-Level Design 1
© McGraw Hill 5
Basic Component Design Principles
• Open-Closed Principle (OCP). “A module [component] should be open for
extension but closed for modification. Stated simply, you should specify the
component in a way that allows it to be extended (within the functional domain that it
addresses) without the need to make internal (code or logic-level) modifications to
the component itself.
© McGraw Hill 6
Basic Component Design Principles
• Interface Segregation Principle (ISP). “Many client-specific interfaces are
better than one general purpose interface. There are many instances in which
multiple client components use the operations provided by a server class. ISP suggests
that you should create a specialized interface to serve each major category of clients.
• Release Reuse Equivalency Principle (REP). “The granule of reuse is the
granule of release.”When classes or components are designed for reuse, an implicit
contract is established between the developer of the reusable entity and the people who
will use it. The developer commits to establish a release control system that supports
and maintains older versions of the entity while the users slowly upgrade to the most
current version. Rather than addressing each class individually.
• Common Closure Principle (CCP). “Classes that change together belong
together.”Classes should be packaged cohesively. That is, when classes are packaged
as part of a design, they should address the same functional or behavioral area.
• Common Reuse Principle (CRP). “Classes that aren’t reused together
should not be grouped together.”When one or more classes with a package
changes, the release number of the package changes. All other classes or packages that
rely on the package that has been changed must now update to the most recent release
of the package and be tested to ensure that the new release operated without incident.
© McGraw Hill 7
Component-Level Design Guidelines
• Components - Naming conventions should be established for
components that are specified as part of the architectural model
and then refined and elaborated as part of the component-level
model.Architectural component names should be drawn from the
problem domain and should have meaning to all stakeholders
who view the architectural model.
• Interfaces - provide important information about communication
and collaboration (as well as helping us to achieve the O PC).
• Dependencies and Inheritance – For readability, it is a good
idea to model dependencies from left to right and inheritance
from bottom (derived classes) to top (base classes).
© McGraw Hill 8
Cohesion
Traditional view - the “single-mindedness” of a module.
Object-Oriented view - cohesion implies that a component
encapsulates only attributes and operations that are closely related
to one another and the component itself.
Levels of cohesion:
• Functional - module performs one and only one computation.
• Layer - occurs when a higher layer accesses the services of a lower layer,
but lower layers do not access higher layers. Eg- SafeHome security
function requirement to make an outgoing phone call if an alarm is sensed.
• Communicational - All operations that access the same data are defined
within one class.
© McGraw Hill 9
Coupling
Traditional view - degree to which a component is connected to
other components and to the external world.
Object-Oriented view - qualitative measure of the degree to
which classes are connected to one another.
Levels of coupling.
• Content - occurs when one component “surreptitiously modifies data that is
internal to another component.
• Control – occurs when control flags a passed to components to requests
alternate behaviors when invoked.
• External - occurs when a component communicates or collaborates with
infrastructure components.
© McGraw Hill 10
Problem Domain
● The problem domain represents the area or subject matter that a
system or software application is designed to address.
● It focuses on the specific problem or set of problems that the
software is intended to solve.
● In software development, understanding the problem domain is
crucial for defining requirements, designing solutions, and
implementing features that directly address the needs of users
or stakeholders.
● It includes the business rules, processes, and requirements that
are relevant to the application or system.
© McGraw Hill 11
Infrastructure Domain
● The infrastructure domain, on the other hand, deals with the
underlying technical foundation and components that support
the software or system.
● This includes hardware, networking, servers, databases,
operating systems, and other technical aspects necessary for the
functioning and deployment of the software.
● Infrastructure domain considerations are more focused on the
technical and operational aspects of the system, ensuring that it
has the necessary resources, scalability, security, and
performance to meet the requirements of the problem domain.
© McGraw Hill 12
Component-Level Design 1
© McGraw Hill 13
Collaboration Diagram with Message Detail
© McGraw Hill 14
Define Interfaces
© McGraw Hill 15
Component-Level Design 2
• Step 3c. Elaborate attributes and define data types and data
structures required to implement them.
• Step 3d. Describe processing flow within each operation in
detail.
• Step 4. Describe persistent data sources (databases and files) and
identify the classes required to manage them.
• Step 5. Develop and elaborate behavioral representations for a
class or component.
• Step 6. Elaborate deployment diagrams to provide additional
implementation detail.
• Step 7. Factor every component-level design representation and
always consider alternatives.
© McGraw Hill 16
Describe Processing Flow
© McGraw Hill 17
Elaborate Behavioral Representations
© McGraw Hill 18
Component-Level Design for WebApps
WebApp component is:
1. a well-defined cohesive function that manipulates content or
provides computational or data processing for an end-user, or.
2. a cohesive package of content and functionality that provides
end-user with some required capability.
© McGraw Hill 19
WebApp Content Design
Focuses on content objects and the manner in which they may be packaged for
presentation to a WebApp end-user
Consider a Web-based video surveillance capability within
SafeHomeAssured.com potential content components can be defined for the
video surveillance capability:
1. the content objects that represent the space layout (the floor plan) with
additional icons representing the location of sensors and video cameras;
2. the collection of thumbnail video captures (each an separate data object), and
3. the streaming video window for a specific camera.
© McGraw Hill 20
WebApp Functional Design
Modern Web applications deliver increasingly sophisticated processing
functions that:
1. perform localized processing to generate content and navigation capability
in a dynamic fashion;
2. provide computation or data processing capability that is appropriate for
the WebApp’s business domain;
3. provide sophisticated database query and access, or.
4. establish data interfaces with external corporate systems.
To achieve these (and many other) capabilities, you will design and construct
WebApp functional components that are identical in form to software
components for conventional software.
© McGraw Hill 21
Component-Level Design for Mobile Apps
Thin web-based client.
• Interface layer only on device.
• Business and data layers implemented using web or cloud
services.
Rich client.
• All three layers (interface, business, data) implemented on
device.
• Subject to mobile device limitations.
© McGraw Hill 22
Traditional Component-Level Design 2
© McGraw Hill 23
Component-Based Software Engineering (CBSE)
The software team asks:
• Are commercial off-the-shelf (COTS) components available to
implement the requirement?
• Are internally-developed reusable components available to
implement the requirement?
• Are the interfaces for available components compatible within
the architecture of the system to be built?
© McGraw Hill 24
CBSE Benefits
• Reduced lead time. It is faster to build complete applications from a pool of
existing components.
• Greater return on investment (ROI). Sometimes savings can be realized by
purchasing components rather than redeveloping the same functionality
in-house.
• Leveraged costs of developing components. Reusing components in
multiple applications allows the costs to be spread over multiple projects.
• Enhanced quality. Components are reused and tested in many different
applications.
• Maintenance of component-based applications. With careful engineering, it
can be relatively easy to replace obsolete components with new or enhanced
components.
© McGraw Hill 25
CBSE Risks
• Component selection risks. It is difficult to predict component behavior for
black-box components, or there may be poor mapping of user requirements to
the component architectural design.
• Component integration risks. There is a lack of interoperability standards
between components; this often requires the creation of “wrapper code” to
interface components.
• Quality risks. Unknown design assumptions made for the components makes
testing more difficult, and this can affect system safety, performance, and
reliability.
• Security risks. A system can be used in unintended ways, and system
vulnerabilities can be caused by integrating components in untested
combinations.
• System evolution risks. Updated components may be incompatible with user
requirements or contain additional undocumented features.
© McGraw Hill 26
Component Refactoring
• Most developers would agree that refactoring components to
improve quality is a good practice.
• It is hard to convince management to expend resources fixing
components that are working correctly rather than adding new
functionality to them,
• Changing software and failing to document the changes can lead
to increasing technical debt.
• Reducing this technical debt often involves architectural
refactoring, which is generally perceived by developers as both
costly and risky.
• Developers can make of tools to examine change histories to
identify the most cost effective refactoring opportunities,
© McGraw Hill 27
Because learning changes everything. ®
www.mheducation.com
© 2020 McGraw-Hill Education. All rights reserved. Authorized only for instructor use in the classroom.
No reproduction or further distribution permitted without the prior written consent of McGraw-Hill Education.
Accessibility Content: Text Alternatives for Images
© McGraw Hill 29
Class-based Component-Level Design – Text
Alternative
Return to parent-slide containing images.
The diagram shows how to describe a process flow. The flow starts
with an initial state. The next process are: validate attributes input,
access paper D B for weight, (this returns base cost per page),
paper cost per page equals base cost per page. The next flow in the
diagram shows three conditions: if size = B; if size = C; and if size
= D. Each cost returns a paper cost per page. B = 1,2; C = 1.4; D =
1.6. The next flow in the diagram is a condition for color. If color is
custom, then paper cost per page = 1.14 and if color is standard.
The process then returns the final paper cost per page. End state.