Chapter 5 System Design
Chapter 5 System Design
➢System Design
➢System Design process
➢Object Oriented Design
➢Architectural Design
➢State Machine Modeling
➢Component Modeling
➢Deployment Diagrams
➢Collaboration Modeling
1
System Design
➢System design: focuses on the process of defining the
architecture, modules, interfaces, data structures, and
software and hardware components necessary to
implement it.
➢System Design Process : transforms the analysis model into
design model/system design.
✓is a process that focuses on decomposing the system into
manageable parts.
➢Like analysis, system design is an evolutionary and iterative
activity.
➢Object Oriented Design is the concept that forces
programmers to plan out their code in order to have a
better flowing program.
2
Cont’d…
➢Unlike analysis, there is no external agent, such as the
client, to review the successive iterations and to ensure
better quality.
➢Several alternatives exist, such as using the
developers who were not involved in system design to
act as independent reviewers, or to use developers
from another project to act as a peer review.
➢Like analysis model, we need to ensure that the
system design model is correct, complete, consistent,
realistic, and readable.
3
Objectives
➢To explain how a software design may be
represented as a set of interacting objects that
manage their own state and operations
➢To describe the activities in the object-oriented
design process
➢To introduce various models that can be used to
describe an object-oriented design
➢To show how the UML may be used to represent
these models
4
Object design includes four groups of activities
5
Cont’d…
3.Restructuring: manipulate the system model to increase code
reuse or meet other design goals.
4.Optimization: address performance requirements of the
system model.
➢ This includes:
✓ changing algorithms to respond to speed or memory
requirements,
✓reducing multiplicities in associations to speed up queries,
✓rearranging execution orders,
✓adding derived attributes to improve the access time to
objects
6
From Analysis to Design
➢Each element of the analysis model provides
information that is necessary to create design models.
✓ The data/class modelling transforms analysis
classes into design classes along with the data
structures required to implement the software.
✓ The architectural design defines the relationship
between major structural elements of the software.
✓ Architectural styles and design patterns help to
achieve the requirements defined for the system.
✓ The interface design describes how the software
communicates with systems that interoperate with
it and with humans that use it. 7
7
From analysis through implementation
Analysis Design
Investigation of the Implementation
problem Logical solution code
8
Design
➢A software design specifies how a program will accomplish
its requirements.
That is, a software design determines:
✓how the solution can be broken down into manageable
pieces
✓what each piece will do.
➢Design transforms requirements into:
✓an architecture diagram
✓subsystems, modules and their relationships
6-9
Object Oriented Design
➢Designing systems using self-contained objects and object
classes.
➢Characteristics:
✓Objects are abstractions of real-world or system entities and
manage themselves.
✓Objects can be independent and encapsulate state and
representation information/behavior.
✓System functionality is expressed in terms of object services
✓Shared data areas are eliminated.
✓Objects communicate by message passing
10
Objects
➢ An object is an entity which has a state and a defined set of
operations which operate on that state.
✓ The state is represented as a set of object attributes.
✓ The operations associated with the object provide services
to other objects (clients) which request these services when
some computation is required.
➢ Objects are created according to some object class
definition.
✓ An object class definition serves as a template for objects.
✓ It includes declarations of all the attributes and services
which should be associated with an object of that class.
11
Cont’d….
OOD Activities:
➢Identification of existing components
➢Full definition of associations
➢Full definition of classes
➢Specifying the contract for each component
➢Choosing algorithms and data structures
➢Identifying possibilities of reuse
12
Object identification
➢Identifying objects (or object classes) is the most
difficult part of object oriented design.
➢There is no 'magic formula' for object identification.
➢ It relies on the skill, experience and domain knowledge
of system designers.
➢Object identification is an iterative process. You are
unlikely to get it right first time.
13
Design models
➢Design models show the objects and object classes
and relationships between these entities.
➢Static models describe the static structure of the
system in terms of object classes and relationships.
➢Dynamic models describe the dynamic interactions
between objects.
14
Software Architecture
➢Architecture: The overall structure of the software
and the ways in which that structure provides
conceptual integrity for a system.
➢The output of this design process is a description
of the software architecture.
➢Each structure comprises software elements ,
relations among them, and properties of both
elements and relations.
15
Architectural design
➢Architectural design: The design process for identifying
the sub-systems making up a system and the framework
for sub-system control and communication.
➢Once interactions between the system and its
environment have been understood, you use this
information for designing the system architecture.
16
Architectural Types(layered approach)
➢"Tier" can be defined as "one of two or more rows,
levels, or ranks arranged one above another".
❖1-Tier Architecture:
✓ the simplest, single tier on single user
✓ is equivalent of running an application on a personal
computer.
✓All the required component to run the application are
located within it.
17
Cont’d…
✓User interface and data storage are all located on the
same machine.
✓They are the easiest to design, but the least scalable.
✓Because they are not part of a network, they are useless
for designing web applications.
❑Note: A layer is a subsystem that provides a service to
another subsystem.
18
Cont’d…
❖2-Tier Architectures:
✓ supply a basic network between a client and a server.
✓ For example, the basic web model is a 2-Tier
Architecture. A web browser makes a request from a web
server, which then processes the request and returns the
desired response, in this case, web pages.
19
Cont’d…
❖3-Tier Architecture:
➢ An architectural style, where an application consists of 3
hierarchically ordered subsystems.
✓So the 3 layers commonly known as:
▪ User interface: Presentation Layer(PL/UI)
▪ Middleware: Business Logic Layer(BLL) &
▪ Database system: Data Access Layer(DAL).
20
Cont’d…
21
Cont’d…
➢Three-Layer architectural style are often used for the
development of Websites:
✓The Web Browser implements the user interface
✓ The Web Server serves requests from the web browser
✓ The Database manages and provides access to the
persistent data.
22
Cont’d…
❖4-Layer-architectural styles (4-Tier Architectures) are
usually used for the development of electronic commerce
sites. The layers are
✓ The Web Browser, providing the user interface
✓ A Web Server, serving static HTML requests
✓ An Application Server, providing session management
(for example the contents of an electronic shopping
cart) and processing of dynamic HTML requests
✓ A back end Database, that manages and provides
access to the persistent data.
23
1 tier architecture
24
2 tier architecture
25
3 tier architecture
26
Summary of three-tier architecture
27
4 tier architecture
28
Use of Architectural models
➢As a way of facilitating discussion about the system design
➢ The architectural view of a system is useful for
communication with system developers and other actors in
re-engineering process.
➢ Stakeholders can relate to it and understand an abstract
view of the system.
➢They can then discuss the system as a whole without being
confused by detail.
➢ As a way of documenting an architecture that has been
designed
29
Detailed Design
➢Detailed design is the process of completely specifying
an architectural design such that module implementation
can proceed independently.
➢Interface specifications
✓brief description of each module
✓Attributes
✓brief description and specify types
➢operations
✓brief description
✓list of parameters and parameter types
✓return type (if applicable)
➢Algorithm and data structure specification 30
System Design
8. Boundary
1. Identify Design Goals Conditions
Additional NFRs (non functional requirements) Initialization
Trade-offs Termination
Failure.
2. Subsystem Decomposition 7. Software
Layers vs Partitions Control
Coherence Vs Coupling(degree of interdependence)
Monolithic
Event-Driven
3. Identify Concurrency Conc. Processes
Identification of 4. Hardware/ 5. Persistent Data 6. Global Resource
Parallelism Software Mapping Management Handlung
(Processes, Identification of Nodes Storing Persistent Access Control
Threads) Special Purpose Systems Objects ACL vs Capabilities
Buy vs Build Filesystem vs Database Security
Network Connectivity
31
State Machines
➢A state is a condition in which an object can be at some
point during its lifetime, for some finite amount of time.
➢An object can do any or all of the following while it's in a
particular state:
--Perform an activity.
--Wait for an event.
--Satisfy one or more conditions.
➢the UML constructs that you can use to model discrete
object behavior in terms of the states an object can reside
in and the transitions that can happen between those
states.
32
State Machines
➢ The activity addresses both:
-- behavioral state machines, which specify sequences
of states that objects go through during their lifetimes
in response to events and the responses that the
objects make to those events,
--and protocol state machines, which specify which
operations of a given class can be called when
instances of that class are in particular states and
under which conditions.
➢The UML notation for a state is a rectangle with
rounded corners.
33
State Machines
➢A state can be a passive quality, such as On and Off
for a light object.
➢ A state can also be an active quality, or something
that an object is doing.
➢ For example, a coffeemaker has the state Brewing
during which it is brewing coffee.
34
State Machines
36
Cont’d…
37
Cont’d…
➢An object doesn't have to go from one state to a different
state within a transition.
➢A self-transition is a transition whose source state and
target state are the same.
➢Let us see some transitions that an Order object might go
through.
38
Cont’d…
➢The transition from Packaging to Shipping is triggerless,
just like the ones that appear on activity diagrams.
➢The transition from Shipping to Shipped occurs when the
shipConfirm event occurs; the Order object records the
change in state by performing a call action (invoking the
setFulfilledFlag method on itself).
➢The Retrieving Books state has a self-transition.
➢The symbol for a state may contain any of several other
pieces of information, as follows:
▪An entry action is an action that the object always performs
immediately upon entering the given state.
39
Cont’d…
This appears as entry/actionName within the state symbol.
If a self-transition occurs, the object performs the entry
action.
Entry Action
Exit Action
40
Cont’d…
▪A deferred event is an event that's of interest to the object,
but which the object defers handling until the object
reaches a different state.
This is shown as eventName/defer.
Deferred events get put into a queue; when the object
changes state, the object first checks to see whether there
are events in the queue to which it can now respond.
42
Cont’d…
✓ A junction makes it possible to build a single overall
transition from a series of transition fragments.
44
Cont’d…
✓A terminate represents the termination of the execution
of a state machine.
➢In state machine diagram, the emphasis is the flow of
control between states.
45
Component Diagram
➢A component is a physical and replaceable part of a system
that conforms to and provides the realization of a set of
interfaces.
➢You use components to model the physical things that may
reside on a node, such as: executables, libraries, tables, files,
and documents.
➢As we stated before, a component is a physical thing that
conforms to and realizes a set of interfaces.
➢ Interfaces therefore, bridge, your logical and physical
models.
➢For example, you may specify an interface for a class in a
logical model, and that same interface will carry over to
some physical component that realizes it. 46
Component Diagram
➢A component, by contrast, defines a system's functionality.
➢Just as a component is the implementation of one or more
classes, an artifact (if it's executable) is the implementation
of a component.
➢You model components and their relationships so that:
1.-- Clients can envision the structure and the functionality in
the finished system.
2.-- Developers have a structure to work toward.
3.-- Technical writers who have to provide documentation
and help files can understand what they're writing about.
4.– You are ready for reuse.
47
Component Diagram
➢Graphically, a component is rendered like a class with a
special icon in the upper right corner.
Alternative
Notation
48
Component Diagram
– Ports: Port represents an interaction point between a component
and its environment.
– Connectors
• Connect two components
• Connect the external contract of a component to the internal
structure.
➢A component defines its behaviour in terms of provided
and required interfaces.
➢The next figure shows an example of a component along
with two each of provided interfaces and required
interfaces.
49
Component Diagram
50
Component Diagram
➢Components can be connected by usage dependencies
Usage Dependency
---A usage dependency is a relationship in which one
element requires another element for its full
implementation.
---Is a dependency in which the client requires the presence
of the supplier.
---Is shown as dashed arrow with a <<use>> keyword.
---The arrowhead point from the dependent component to
the one of which it is independent
51
Component Diagram
Ports
➢Specify a distinct interaction point.
54
Component Diagram
55
Deployment Diagram
Nodes
➢A node represents a computational resource that generally
has memory and often has processing capability.
➢The notation for a node is a cube. The name of the node
always appears on the cube; optionally, a list of the
components that reside on that node also appears.
57
Deployment Diagram
➢Nodes represent deployment targets—in other words,
locations on which artifacts can be deployed.
➢An artifact that exists on a particular node is called a
deployed artifact; a deployment is the pairing of a deployed
artifact with a deployment target.
➢A deployment diagram shows how the finished system will
be deployed on one or more machines.
➢It shows the configuration of run time processing nodes
and the components that live on them.
➢ A deployment diagram can include all sorts of features
such as: machines, processes, files and dependencies.
58
Deployment Diagram
Deployment diagram are used:
1. To model embedded systems.
2. To model client/ server systems.
3. To model fully distributed systems.
➢The next figure shows that any number of HTMLClient
nodes (each hosting a WebBrowser) and GUIClient nodes
communicate with two server machines, each hosting a
WebServer and a CootBusinessServer; each WebServer
communicates with a CootBusinessServer; and each
CootBusinessServer communicates with a DBMS running on
one of two DBServer nodes.
59
Deployment Diagram
60
Deployment Diagram
➢System architectures can be depicted in UML on a
deployment diagram.
➢Deployment diagrams are similar to class diagrams and
object diagrams in that they can show:
---possible architectures (node types),
---and actual architectures (node instances).
➢When showing node instances, just like objects on an
object diagram, the node label takes the form name:Type,
and should be underlined.
➢Nodes can be given multiplicities to indicate how many
might exist at run time: thus, in this diagram, we have nodes
that are duplicated (CootServer and DBServer) and nodes
that are multiplied (CootHTMLClient and CootGUIClient).
61
Deployment Diagram
62
Deployment Diagram
63
Documenting Object Design
➢Object design is documented in the Object Design
Document (ODD).
➢ It describes:
✓ object design trade-offs made by developers,
✓ guidelines they followed for subsystem interfaces,
✓ the decomposition of subsystems into packages and
classes, and the class interfaces.
➢The audience for the ODD includes system architects, (i.e.,
the developers who participate in the system design),
developers who implement each subsystem, and testers.
64
Cont’d…
➢The ODD enables developers to understand the subsystem
sufficiently well that they can use it. In general, an interface
specification should satisfy the following criteria.
✓Restrictiveness. A specification should be precise enough
that it excludes unwanted implementations.
✓ Generality. A specification, however, should not restrict its
implementation. This allows developers to develop and
substitute increasingly efficient or elegant implementations
that may not have been thought of when the subsystem was
specified.
✓ Clarity. A specification should be easily and unambiguously
understandable by developers.
65
Documenting System Design
➢System design is documented in the System Design
Document (SDD).
➢ It describes :
✓design goals set by the project,
✓the subsystem decomposition (with UML class
diagrams),
✓ the hardware/software mapping (with UML
deployment diagrams),
✓ the data management, and access control,
✓ control flow mechanisms, and boundary conditions.
66
Cont’d…
➢The SDD is used to define interfaces between teams of
developers and as reference when architecture-level
decisions need to be revisited.
➢The audience for the SDD includes:
✓ the project management team,
✓ the system architects (i.e., the developers who participate
in the system design),
✓and the developers who design and implement each
subsystem.
67
End of Chapter four
68