Session 3 - Software Architecture Styles - Complete
Session 3 - Software Architecture Styles - Complete
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.
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
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
Hybrid architectures
8
LAYERED ARCHITECTURE
9
STYLE
The program is partitioned into an
array of layers or groups.
10
EXAMPLES
▪ System software is typically designed using the layered
architecture style;
▪ examples include Microsoft .NET, Unix operating system, TCP/IP, etc.
11
Layers are highly cohesive and promote information
hiding.
12
DISTRIBUTED SOFTWARE
13
ARCHITECTURE
14
PEER TO PEER (P2P)
P2P EXAMPLES
15
P2P – ADVANTAGES & LIMITATIONS
▪ Improved Reliability (LAN messenger, Bluetooth/Wi-Fi
Connectivity)
▪ Better Privacy (End to End encrypted Transmission Vs. Storage
Encryption)
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.
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.
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.
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 "semantic" analyzer checks type checking, scope of variables etc. Reads the
abstract syntax tree and writes an appropriately augmented abstract syntax tree.
▪ 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.
▪ 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.
31