You are on page 1of 13

Lecture 10.

Design Concepts:System Architectural


Styles
Prepared by:
Ms. Sundas Shujah
Lecturer DCS, CUI, Abbottabad Campus
System Layers

• A hierarchical decomposition of a system yields an ordered set of layers.

• A layer is a grouping of subsystems providing related services, possibly realized using services from another
layer.

• Layers are ordered in that each layer can depend only on lower level layers and has no knowledge of the
layers above it.

• Top Layer and Bottom Layer:

The layer that does not depend on any other layer is called the bottom layer, and the layer that is not used by
any other is called the top layer
System Layers

How partitioning is done:

In general, a subsystem decomposition is the result of both partitioning and layering. We first partition the
system into top-level subsystems, which are responsible for specific functionality or run on a
specific hardware node. Each of the resulting subsystems are, if complexity justifies it, decomposed into lower-
and lower-level layers until they are simple enough to be implemented by a single developer.
Architectural Styles

A software architecture includes system decomposition, global control flow, handling of boundary conditions, and
intersubsystem communication protocols.

Repository:

In the repository architectural style, 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).
Architectural Styles: Repository

• Examples:
Repositories are typically used for database management
systems, such as a payroll system or a bank system.

• Compilers and software development environments also


follow a repository architectural style(The different Advantages:
The central location of the data makes it easier to
subsystems of a compiler access and update a central parse
deal with
tree and a symbol table. Debuggers and syntax editors concurrency and integrity issues between
subsystems.
access the symbol table as well.)
Repositories are well suited for applications with
constantly changing, complex dataprocessing
tasks. Once a central repository is well defined,
we can easily add new services in the
form of additional subsystems.
Architectural Styles: MVC

In the Model/View/Controller (MVC) architectural


style (Figure 6-15), subsystems are classified into three The model subsystems are developed such that
different types: they do not depend on any view or controller
subsystem.
model subsystems maintain domain knowledge Changes in their state are propagated to the
view subsystems display it to the user view subsystem via a subscribe/notify protocol.
The MVC is a special case of the repository
controller subsystems manage the sequence of where Model implements the central data
interactions with the user. structure and control objects dictate the
control flow.
MVC

For example, The flow of events in editing the file in MVC will be:
1. The InfoView and the FolderView both subscribe for changes to
the File models they
display (when they are created).
2. The user types the new name of the file.
3. The Controller, the object responsible for interacting with the user
during file name
changes, sends a request to the Model.
4. The Model changes the file name and notifies all subscribers of
the change.
5. Both InfoView and FolderView are updated, so the user sees a
consistent change.
Architectural Styles: Client/Server

Example: An information system with a central


In the client/server architectural style (a subsystem, the
database is an example of a client/server architectural
server, provides style.
services to instances of other subsystems called the The clients are responsible for receiving inputs from
the user, performing
clients, which are responsible for interacting with the
range checks, and initiating database transactions
user. when all necessary data are collected.

The request for a service is usually done via a remote The server is then responsible for performing the
procedure call mechanism or a common object broker e.g transaction and guaranteeing the integrity of the
data. In this case, a client/server architectural style is a
HTTP for web pages
special case of the repository architectural style in
which the central data structure is managed by a
Control flow in the clients and the servers is process.
independent except for synchronization to manage
requests or to receive request.
Client/Server

NOTE:
Client/server systems, however, are not restricted to a single server.
On the World Wide Web, a single client
can easily access data from thousands of different servers
Architectural Styles: Peer-to-peer

Peer-to-peer

A peer-to-peer architectural style (see Figure 6-20) 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.
Example:
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.
Architectural Styles: Three-tier

Three-tier

The three-tier architectural style organizes


subsystems into three layers
• The interface layer includes all boundary objects
that deal with the user, including windows, forms, web
pages, and so on.

• The application logic layer includes all control and


entity objects, realizing the processing, rule checking,
and notification required by the application.

• The storage layer realizes the storage, retrieval, and


query of persistent objects.
Architectural Styles: Four-tier

Four-tier

The four-tier architectural style is a three-tier architecture For example, a banking


information system can
in which the Interface layer is decomposed into a
include a
Presentation Client layer and a Presentation Server layer. host of different clients,
such as a Web browser
The Presentation Client layer is located on the user interface for home users,
machines, whereas the Presentation Server layer can be an Automated Teller
located on one or more servers. Machine, and an
application client for bank
employees.
The four-tier architecture enables a wide range of different
presentation clients in the application, while reusing some
of the presentation objects across clients.
Architectural Styles: Pipe and filter

Pipe and filter

In the pipe and filter architectural style subsystems process


Advantage:
data received from a set of inputs and send results to other The pipe and filter architectural
subsystems via a set of outputs. style is modifiable: filters can be
substituted for others
The subsystems are called “filters,” and the associations
or reconfigured to achieve a
different purpose.
between the subsystems are called “pipes.” The best known example of a pipe
Each filter knows only the content and the format of the data and filter architectural style is the
received on the input pipes, not the filters that produced them.
Unix shell

Each filter is executed concurrently, and synchronization is


accomplished via the pipes.

You might also like