0% found this document useful (0 votes)
15 views31 pages

Session 3 - Software Architecture Styles - Complete

The document provides an overview of software architectural styles, defining them as patterns that abstract common properties of similar designs. It categorizes various styles such as Layered, Client-Server, and Peer-to-Peer, detailing their components, advantages, and limitations. Additionally, it discusses the importance of hybrid architectures that may incorporate multiple styles within a single system.

Uploaded by

shanireal420
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views31 pages

Session 3 - Software Architecture Styles - Complete

The document provides an overview of software architectural styles, defining them as patterns that abstract common properties of similar designs. It categorizes various styles such as Layered, Client-Server, and Peer-to-Peer, detailing their components, advantages, and limitations. Additionally, it discusses the importance of hybrid architectures that may incorporate multiple styles within a single system.

Uploaded by

shanireal420
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

SOFTWARE DESIGN AND

ARCHITECTURE
Architectural Styles 1
OUTLINE
▪ Introduction to architectural styles
▪ Categorizations of architectural styles

2
3
ARCHITECTURAL STYLES
▪ An architecture style (also known as an “architecture pattern”)
abstracts the common properties of a family of similar designs.

▪ Define a family of systems in terms of a pattern of its structural


organization.

4
COMPONENTS OF A STYLE
The key components of an architecture style are:
▪ Elements/components
▪ that perform functions required by a system
▪ connectors
▪ that enable communication, coordination, and
cooperation among elements
▪ constraints
▪ that define how elements can be integrated to form
the system
▪ attributes
▪ that describe the advantages and disadvantages of
the chosen structure 5
Styles or patterns

Each pattern describes a problem which occurs over and


over again in our environment, and then describes the
core of the solution to that problem, in such a way that
you can use this solution a million times over, without
ever doing it the same way twice.
Alexander et al

6
CATEGORIES OF ARCHITECTURAL STYLES
▪ Hierarchal Software ▪ Event Based Software
Architecture Architecture
▪ Layered
▪ Data Centered Software
▪ Distributed Software Architecture
Architecture ▪ Black board
▪ Client Server ▪ Shared Repository
▪ P2P
▪ Interaction-Oriented
▪ SOA Software Architectures
▪ Data Flow Software ▪ Model View Controller
Architecture (MVC)
▪ Pipe n Filter
▪ Batch Sequential

7
Several Important Architectural Styles
Layered style

Client Server
SEVERAL
IMPORTANT
Peer to Peer (P2P) style

ARCHITECTU
Pipe-and-Filter style
RAL STYLES
Shared-Repository style

Model View Controller

Hybrid architectures
8
LAYERED ARCHITECTURE
9
STYLE
The program is partitioned into an
array of layers or groups.

LAYERED STYLE Layers use the services of the layer or


ARCHITECTURES layers below and provide services to
the layer or layers above.

The Layered style is among the most


widely used of all architectural styles.

10
EXAMPLES
▪ System software is typically designed using the layered
architecture style;
▪ examples include Microsoft .NET, Unix operating system, TCP/IP, etc.

OSI Reference model Application Framework

11
Layers are highly cohesive and promote information
hiding.

Layers are not strongly coupled to layers above them,


reducing overall coupling.

Layered Style Layers help decompose programs, reducing complexity.


Advantages
Layers are easy to alter or fix by replacing entire layers,
and easy to enhance by adding functionality to a layer.

Layers are usually easy to reuse

Lower runtime performance since a client's request or


a response to a client must go through potentially
Limitations several layers.

Exceptions and error handling are issues in the layered


architecture, since faults in one layer must propagate
upward to all calling layers.

12
DISTRIBUTED SOFTWARE
13
ARCHITECTURE
14
PEER TO PEER (P2P)
P2P EXAMPLES

▪ A peer-to-peer (P2P) architecture consists of a decentralized


network of peers - nodes that are both clients and servers without
the need for a centralized server.
▪ Gnutella, Kazaa, Instant Messaging (FireChat, Briar)

15
P2P – ADVANTAGES & LIMITATIONS
▪ Improved Reliability (LAN messenger, Bluetooth/Wi-Fi
Connectivity)
▪ Better Privacy (End to End encrypted Transmission Vs. Storage
Encryption)

▪ Client Synchronization may limit performance


▪ one full copy of every file or message must exist between the
participating users
▪ Storage requirement

16
17
CLIENT SERVER
ARCHITECTURAL STYLE
CLIENT SERVER ARCHITECTURAL STYLE
▪ Client/server architecture illustrates the relationship between
two computer programs in which one program is a client, and
the other is Server.

▪ Client makes a service request to server.

▪ Server provides service to the request.

18
COMMON EXAMPLE
▪ The World Wide Web is an
example of client-server
architecture.
▪ Each computer that uses a
Web browser is a client, and
the data on the various Web
pages that those clients
access is stored on multiple
servers.

19
ADVANTAGES
▪ Transparency of location.
▪ Mix and match heterogeneous platforms
▪ Easy to add new servers or upgrade existing servers.

DISADVANTAGES
▪ Performance of the system depends on the performance of the
network.
▪ Tricky to design and implement C/S systems.

20
DATA FLOW SOFTWARE
21
ARCHITECTURE
22
PIPES-AND-FILTERS
STYLE
PIPE AND FILTER
▪ This architecture decomposes the whole system into components
of data source, filters, pipes, and data sinks.

▪ The connections between components are data streams (e.g.


elements within a file)

▪ The particular property attribute of the pipe and filter architecture


is its concurrent and incremented execution.
Example: Streaming of a video

Suitable for applications that require a defined series of


independent computations to be performed on data.

23
FILTER
▪ Each filter is an independent data stream transformer;
▪ it reads data from its input data stream, transforms and processes it,
and then
▪ writes the transformed data stream over a pipe for the next filter to
process.

▪ A filter does not need to wait for batched data as a whole.


▪ As soon as the data arrives through the connected pipe, the filter
can start working right away.

24
PIPES
▪ The connectors serve as channels for the
streams, transmitting outputs of one filter to
inputs of the other.
▪ This makes connectors act as Pipes.
▪ A pipe moves a data stream from one filter to
another.
▪ A pipe can carry binary or character streams.
▪ A pipe is placed between two filters; these
filters can run in separate threads of the
same process.
25
STRUCTURE

26
EXAMPLE:
ARCHITECTURE OF A COMPILER
▪ Compilation is regarded as a sequential (pipeline) process.
▪ Every phase is dependent on some data on the preceding phase.

27
COMPILER
▪ The system might consist of a pipeline of processing elements similar to the
following:
▪ A source element reads the program text (i.e., source code) from a file (or perhaps a
sequence of files) as a stream of characters.

▪ A lexical analyzer converts the stream of characters into a stream of lexical tokens
for the language--keywords, identifier symbols, operator symbols, etc.

▪ A parser/syntax analyzer recognizes a sequence of tokens that conforms to the


language grammar and translates the sequence to an abstract syntax tree.

▪ A "semantic" analyzer checks type checking, scope of variables etc. Reads the
abstract syntax tree and writes an appropriately augmented abstract syntax tree.

▪ A global optimizer (usually optionally invoked) corresponds to program that is


more efficient in space and time resource usage.

▪ A backend code generator translates intermediate code to final code (i.e., for some
particular hardware processor augmented by operating system calls and a runtime
library). 28
FEW MORE EXAMPLES

29
BENEFITS:
▪ Concurrency: It provides high overall throughput for excessive data
processing.

▪ Reusability: Encapsulation of filters makes it easy to plug and play, and to


substitute.

▪ Flexibility: It supports both sequential and parallel execution.

▪ Modifiability: It features low coupling between filters, less impact from adding
new filters.

DISADVANTAGES
▪Not good choice for interactive systems, because of their transformational
characteristic.

30
▪ Most systems of any size include several
architectural styles, often at different
levels of abstraction.

▪ An overall a system may have a


HYBRID Layered style, but the one layer may
use the Pipe-and- Filter style, and
ARCHITECTURES another the Shared-Data style.

▪ An overall system may have a Pipe-


and- Filter style, but the individual
filters may have Layered styles.

31

You might also like