UNIT-3
UNIT-3
Vijaya Bharathi
Assistant Professor
Department of CSE
GITAM Deemed to Be University
Visakhapatnam – 530045
Email: [email protected]
Mobile-8897987132
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
1
UNIT-3
System Design
Decomposing the System
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
2
Syllabus
PART 1 : System Design: Decomposing the System
8.Identifying Subsystems
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
3
PART 2 :System Design: Addressing Design Goals
Identifying Services
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
4
FLOOR PLAN EXAMPLE
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
5
Example of floor plan design
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
6
Part 1 :system design concepts
♦ Subsystem :Collection of classes, associations, operations,
events and constraints that are interrelated
⬥ Seed for subsystems: UML Objects and Classes.
♦ (Subsystem) Service:
⬥ Group of operations provided by the subsystem
⬥ Seed for services: Subsystem use cases
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
7
• subsystem -- a smaller, simpler part of a larger system
• a subsystem is made of a number of solution domain classes
• often one developer or development team is responsible for one subsystem
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
8
1.Sub systems and classes
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
9
2.Services and sub systems interfaces
♦ A subsystem is characterized by the services it provides to other
subsystems. A service is a set of related operations that share a
common purpose.
♦ A subsystem providing a notification service, for example, defines
operations to send notices, look up notification channels, and
subscribe and unsubscribe to a channel.
♦ The set of operations of a subsystem that are available toother
subsystems form the subsystem interface.
♦ The subsystem interface includes the name of the operations, their
parameters, their types, and their return values. System design
focuses on defining the services provided by each subsystem, that
is, enumerating the operations, their parameters, and their high-
level behavior.
♦ Object design will focus on the application programmer interface
(API), which refines and extends the subsystem interfaces.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
10
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
11
♦ In UML, components can represent both logical and physical
components. A logical component corresponds to a subsystem
that has no explicit run-time equivalent
♦ for example, individual business components that are
composed together into a single run-time application logic
layer.
♦ A physical component corresponds to a subsystem that as an
explicit run-time equivalent, for example, a database server.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
12
3.Coupling and Cohesion
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
13
4.Partitions and Layers
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
14
Subsystem Decomposition into Layers
Layer 1
Layer 2
Layer 3
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
15
Relationships between Subsystems
♦ Layer relationship
⬥ Layer A “Calls” Layer B (runtime)
⬥ Layer A “Depends on” Layer B (“make” dependency, compile
time)
♦ Partition relationship
⬥ The subsystem have mutual but not deep knowledge about each
other
⬥ Partition A “Calls” partition B and partition B “Calls” partition A
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
16
Architectural Styles System Design Activities:
♦ A software architecture includes system decomposition, global
control flow, handling of boundary conditions, and intersub
system communication protocols [Shaw & Garlan, 1996].
♦ subsystems access and modify a single data structure called the
central repository.
♦ Subsystems are relatively independent and interact only
through the repository.
♦ Control flow can be dictated either by the central
repository(e.g., triggers on the data invoke peripheral systems)
or by the subsystems (e.g., independent flow of control and
synchronization through locks in the repository)
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
17
Repository :component diagram
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
18
♦ The repository subsystem can also be used for implementing
the global control flow. In the compiler example of Figure
each individual tool (e.g., the compiler, the debugger, andthe
editor) is invoked by the user.
♦ The repository only ensures that concurrent accesses are
serialized. Conversely, the repository can be used to invoke the
subsystems based on the state of the central data structure.
These systems are called “blackboard systems.”
♦ The HEARSAY II speech understanding system [Erman et al.,
1980], one of the first blackboard systems, invoked tools based
on the current state of the blackboard.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
19
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
20
Software Architectural Styles
♦ Subsystem decomposition
⬥ Identification of subsystems, services, and their relationship to each
other.
♦ Specification of the system decomposition is critical.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
21
MVC Architectural style
♦ Model/View/Controller (MVC) architectural style in Figure
subsystems are classified into three different types: model
subsystems maintain domain knowledge, view subsystems
display it to the user, and controller subsystems manage the
sequence of interactions with the user.
♦ The model subsystems are developed such that they do not
depend on any view or controller subsystem. Changes in their
state are propagated to the view subsystem via a
subscribe/notify protocol.
♦ The MVC is a special case of the repository where Model
implements the central data structure and control objects
dictate the control flow
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
22
MVC
MVC is well suited for interactive systems, especially when multiple views of
the same model are needed. MVC can be used for maintaining consistency
across distributed data; however it introduces the same performance bottleneck
as for other repository styles
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
23
Client/server Architectural style
♦ In the client/server architectural style (Figure), a subsystem,
the server, provides services to instances of other subsystems
called the clients, which are responsible for interacting with the
user.
♦ The request for a service is usually done via a remote
procedure call mechanism or a common object broker (e.g.,
CORBA, Java RMI, or HTTP).
♦ Control flow in the clients and the servers is independent
except for synchronization to manage requests or to receive
results.)
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
24
A peer-to-peer architectural style
♦ style (see Figure) is a generalization of the client/server
architectural style in which subsystems can act both as client or
as servers, in the sense that each subsystem can request and
provide services.
♦ The control flow within each subsystem is independent from
the others except for synchronizations on requests.
♦ An example of a peer-to-peer architectural style is a database
that both accepts requests from the application and notifies to
the application whenever certain data are changed.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
25
Thethree-tier architectural style
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
26
Four -tier architectural style
♦ The four-tier architectural style is a three-tier architecture in
which the Interface layer is decomposed into a
Presentation Client layer and a Presentation
Server layer(Figure ).
♦ The Presentation Client layer is located on the user
machines, whereas the Presentation Server layer can
be located on one or more servers.
♦ The four-tier architecture enables a wide range of different
presentation clients in the application, while reusing some of
the presentation objects across clients.
♦ For example, a banking information system can include ahost
of different clients, such as a Web browser interface for home
users, an Automated Teller Machine, and an application client
for bank employees.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
27
Pipe and filter architectural style
♦ In the pipe and filter architectural style (Figure), subsystems
process data received from a set of inputs and send results to
other subsystems via a set of outputs.
♦ The subsystems are called “filters,” and the associations
between the subsystems are called “pipes.” Each filter knows
only the content and the format of the data received on the
input pipes.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
28
PART 2
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
29
♦ System design consists of transforming the analysis model into
the design model that takes into account the nonfunctional
requirements described in the requirements analysis document.
We illustrate these activities with an example, MyTrip, a route
planning system for car drivers.
♦ We start with the analysis model from MyTrip; then we
describe the identification of design goals and the design of an
initial system decomposition
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
30
♦ System design: consists of transforming the analysis model
into the design model that takes into account the nonfunctional
requirements described in the requirements analysis document.
♦ Starting Point: Analysis Model for a Route Planning System Using MyTrip,
a driver can plan a trip from a home computer by contacting a trip-planning
service on the Web (Plan Trip in Figure ). The trip is saved for later retrieval
on the server.
♦ The trip-planning service must support more than one driver .
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
31
Plan Trip use case of the MyTrip system
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
32
ExecuteTrip use case of the MyTrip system
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
33
Identifying Design Goals
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
34
Performance criteria
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
35
Dependability
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
36
Cost criteria
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
37
Maintenance criteria
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
38
End user criteria
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
39
Identifying Subsystems
♦ The initial subsystem decomposition should be derived from
the functional requirements.
♦ For example, in the MyTrip system, we identify two major
groups of objects: those that are involved during the
PlanTrip use case and those that are involved during the
ExecuteTrip usecase.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
40
♦
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
41
Outline
♦ Problem Statement
♦ Functional Requirements
♦ Nonfunctional Requirements
♦ User Interface
♦ Object Model
♦ System Decomposition
♦ Deployment
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
42
Problem Statement
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
43
Ingredients of a Problem Statement
1. Current situation
⬥ The problem to be solved
⬥ Description of one or more scenarios
2. Objectives
3. Requirements
⬥ Functional and nonfunctional requirements
⬥ Constraints (“pseudo requirements”)
4. Target environment
⬥ The environment in which the delivered system has to perform
a specified set of system tests
5. Project schedule
⬥ Major milestones including deadline for delivery
6. Client acceptance criteria
⬥ Criteria for the system tests.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
44
Current situation: The problem to be solved
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
45
ARENA: The Current Situation
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
46
ARENA: The Objectives
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
47
ARENA: The Objectives (2)
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
48
ARENA Functional Requirements
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
49
ARENA Nonfunctional Requirements
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
50
Constraints
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
51
ARENA Target Environment
Example:
♦ Users must be able to run ARENA games as applets in any Web
Browser
♦ The web page must be validated through the W3C Markup
Validation Service
♦ Interaction with the ARENA Server must be via HTTP/1.1.
To be distinguished from development environment
♦ “Prototypes will be built with Revolution 2.6.1”
♦ “Games will be tested with Internet Explorer and Firefox”
♦ “The implementation language will be Java 1.4.2.”
♦ “The IDE will be Eclipse 3.2”
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
52
Project Schedule
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
53
Client Acceptance Criteria
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
54
(Initial) ARENA Models
♦ Subsystem Decomposition
♦ User Interface of Client
♦ User Interface of Server
♦ Object Model
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
55
ARENA Subsystem Decomposition
User Interface
Tournament User
Advertisement
Management
Component
Management
User Directory
Tournament
Session Statistics
Management
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
56
ARENA Object Model
Game
Tournament
League Style
Tournament KOStyle
RoundRobin
Round
Player Match
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
57
ARENA Object Model (2)
Game
TicTacToe
League TournamentStyle
Asteroids
Tournament KOStyle
RoundRobin
Round
Player Move
Match
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
59
ARENA User Interface (Client)
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
60
ARENA User Interface (Server)
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
61
More Information on ARENA
♦The ARENA Website:
http://sysiphus.in.tum.de/arena
♦ The ARENA case study is described at the end of each
chapter, starting with Chapter 4
♦ Read Chapter 4.6
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
62
PART 2
System Design: Addressing
Design Goals
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
63
GOALS
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
64
ACTIVITIES OF SYSTEM DESIGN
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
65
UMLdeployment diagrams
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
66
♦ UML deployment diagrams, nodes are represented by boxes
containing component icons. Nodes can be stereotyped to denote
physical devices or execution environments.
♦ Communication paths between nodes are represented by solid
lines. The protocol used by two nodes to communicate can be
indicated with a stereotype on the communication path.
♦ Figure 7-2depicts an example of a deployment diagram with two
Web browsers accessing a Web server.
♦ The Web server in turns accesses a database server. We can see
from the diagram that the Web browsers do not directly access the
database at any time
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
67
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
68
PART 3
Addressing Design Goals
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
69
1. Mapping Subsystems to Processors and Components
5. Identifying Services
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
70
Mapping Subsystems to Processors and Components
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
71
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
72
Identifying and Storing Persistent Data
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
73
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
74
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
75
Providing Access Control
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
76
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
77
♦ Defining access control for a multi-user system is usually more
complex than in MyTrip.
♦ In general, we need to define for each actor which operations
they can access on each shared object.
♦ For example, a bank teller may post credits and debits up to a
predefined amount.
♦ If the transaction exceeds the predefined amount, a manager
must approve the transaction. Managers can examine the
branch statistics; but cannot access the statistics of other
branches.
♦ Analysts can access information across all branches of the
corporation, but cannot post transactions on individual
accounts. We model access on classes with an access matrix.
The rows of the matrix represent the actors of the system
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
78
global access table represents explicitly every cell in the matrix
as a (actor,class,operation) tuple. Determining if an
actor has access to a specific object requires looking up the
corresponding tuple.
If no such tuple is found, access is denied.
•An access control list associates a list of (actor,operation)
pairs with each class to be accessed. Empty cells are discarded.
Every time an object is accessed, its access listis checked for the
corresponding actor and operation. An example of an access
control List is the guest list for a party.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
79
Designing the Global Control Flow
♦ Control flow is the sequencing of actions in a system. In object-
oriented systems, sequencing actions includes deciding which
operations should be executed and in which order. These
decisions are based on external events generated by an actor or
on the passage of time.There are two types
♦ Procedure-driven control:Operations wait for input whenever
they need data from an actor. This kind of control flow is mostly
used in legacy systems and systems written in procedural
languages. It introduces difficulties when used with object-
oriented languages. As the sequencing of operations is
distributed among a large set of objects.
♦ Event-driven control: A main loop waits for an external event.
Whenever an event becomes available, it is dispatched to the
appropriate object, based on information associated with the
event. This kind of control flow has the advantage of leading to
asimpler structure and to centralizing all input in the main loop.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
80
♦ Threads : Threads are the concurrent variation of procedure-
driven control: The system can create an arbitrary number of
threads, each responding to a different event. If a thread needs
additional data, it waits for input from a specific actor.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
81
Identifying Services
♦ In this activity, we refine the sub system decomposition by
identifying the services provided by each subsystems. We
review each dependency between subsystems and define an
interface for each service we identified (depicted in UML by a
lollipop). In this activity, we name the identified services.
During object design, we specify each service precisely in
terms of operations, parameters, and constraints.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
82
♦ ConnectionManager allows a subsystem to register with
the CommunicationSubsystem, to authenticate, find other
nodes, and initiate and close connections.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
83
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
84
♦ Boundary conditions of the system—that is, to decide how the
system is started, initialized, and shut down—and we need to
define how we deal with major failures such as data corruption
and network outages, whether they are caused by a software error.
Uses cases dealing with these conditions are called boundary use
cases.
♦ For example, we now have a good idea of how MyTrip should
work in steady state. We have, however, not yet addressed how
MyTrip is initialized.
♦ For example, how are maps loadedinto the
PlanningService? How is MyTrip installed in the car?
How does MyTrip know whichPlanningService to connect
to? How are drivers added to the PlanningService? We
quicklydiscover use cases that have not been specified
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
85
♦ An exception is an event or error that occurs during the execution
of the system. Exceptions are caused by three different sources:
•A hardware failure. Hardware ages and fails. A hard disk crash can
lead to the permanent loss of data. The failure of a network link,
for example, can momentarily disconnect two nodes of the system.
•Changes in the operating environment. The environment also
affects the way a system works. A wireless mobile system can
loose connectivity if it is out of range of a transmitter.
♦ A power outage can bring down the system, unless it is fitted with
back-up batteries.
•A software fault. An error can occur because the system or one of
its components contains a design error. Although writing bug-free
software is difficult, individual subsystems can anticipate errors
from other subsystems and protect against them.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
86
♦ Exception handling is the mechanism by which a system treats
an exception. In the case of a user error, the system should
display a meaningful error message to the user so that she can
correct her input.
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
87
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
88
Thank you
Bernd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java
89