FSE Lecture 8
FSE Lecture 8
1
Architectural Styles
2
Architectural Styles
3
Architectural Styles
4
Categories of Architectural Styles
• Hierarchal Software Architecture • Event Based Software Architecture
• Layered • Data Centered Software Architecture
• Distributed Software Architecture • Black board
• Client Server • Shared Repository
• SOA • Interaction-Oriented Software
• Data Flow Software Architecture Architectures
• Pipe n Filter • Model View Controller
• Batch Sequential • Component-Based Software
Architecture
5
Hierarchal Software Architecture
6
Hierarchal Style
7
Hierarchal Style
• Modules at different levels are connected by explicit or implicit
method invocations.
• a lower-level module provides services to its adjacent upper-level modules,
which invokes the methods or procedures in the lower level.
8
Hierarchal Style
9
Hierarchal Style
• Upper layers provide more abstract functionality in the form of user interfaces
• such as command line interpreters, GUIs, Shell programming facilities, etc.
10
Layered Architecture
11
Layered Style
• Organized hierarchically into layers.
• Each layer provides service to the layer above it and serves as a client to the
layer below.
• The connectors are defined by the protocols that determine how the layers will
interact.
12
A generic Layered Architecture
13
A partial layered architecture example
14
Example: Library System
15
Benefits:
20
Distributed Software Architecture
21
Client Server Architectural Style
22
Client Server Architectural Style
23
Client/Server
24
Client-server Style
• Suitable for applications that involve distributed data and processing across a
range of components.
• Components:
• Servers: Stand-alone components that provide specific services such as printing, data
management, etc.
• Clients: Components that call on the services provided by servers.
25
Common Example
26
Another Example
• If you have to check a bank account from your computer, you have to send a
request to a server program at the bank.
• That program processes the request and forwards the request to its own client
program that sends a request to a database server at another bank computer to
retrieve client balance information.
• The balance is sent back to the bank data client, which in turn serves it back to
your personal computer, which displays the information of balance on your
computer.
27
Client Server Processes
Clients and servers are separate processes,
28
Client Server Processes
29
Client Server Processes
• Several different server processes may run on the same processor but,
often,
• servers are implemented as multiprocessor systems in which a separate instance
of the server process runs on each machine.
30
Example:
a) Gmail
b) Picassa photoviewer
c) Drop box
31
Severs
• Servers commonly contain data files and applications that can be accessed across
the network, by workstations or user computers.
• A user who wants to access data files, would use his or her client computer to
access the data files on the server.
32
Types Of Servers
• Application Servers:
• Applications are hosted on these servers
• Clients can access various application features over the network
33
Types Of Servers
• File Servers:
Those file which We create with other software
34
Types Of Servers
• Database Servers:
• More efficient use of distributing power than file servers.
• Client passes SQL requests as messages to the DB server; results are returned
over the network to the client.
• Query processing done by the server.
• No need for large data transfers.
35
36
Advantages
37
Disadvantages
38
Multi-tier Client Server Architecture
39
Types Of Client Server
• Two-tier client–server architecture
• which is used for simple client–server systems, and in situations where it is important to
centralize the system for security reasons.
• In such cases, communication between the client and server is normally
encrypted.
• Multitier client–server architecture
• which is used when there is a high volume of transactions to be
processed by the server.
40
A Two-tier Client–server Architecture
41
Two-tier Client Server
• A thin-client model,
• where the presentation layer is implemented on the client and all other layers
(data management, application processing, and database) are implemented on a
server.
42
Advantages
43
Disadvantages
44
Two-tier Client Server
• A fat-client model
•
where some or all of the application processing is carried out on the client.
• Data management and database functions are implemented on the server.
45
Multi-tier Client–server Architectures
• This may lead to problems with scalability and performance if the thin-
client model is chosen, or problems of system management if the fat-
client model is used.
46
• Application services such as facilities to transfer cash, generate statements, pay
bills, and so on are implemented in the web server and as scripts that are executed
by the client
47
• This system is scalable because it is relatively easy to add servers (scale out) as
the number of customers increase.
• In this case, the use of a three-tier architecture allows the information transfer
between the web server and the database server to be optimized.
48
Issues
49
Shared Data Software Architecture
Shared Data Software Architecture
• The software system is decomposed into two major partitions: data store and
independent software component or agents.
Shared Data Software Architecture
• The connections between the data module and the software components are
implemented either by explicit method invocation or by implicit
method invocation.
Shared Data Software Architecture
Blackboard style
Repository style
REPOSITORY ARCHITECTURE
Repository Architecture
The software component agents of the data store control the computation and
flow of logic of the system.
Repository architecture
Clients can get data from the data store and put data in the data store.
Different clients may have different interfaces and different data access
privileges.
Example: Integrated Development Environment
CASE Tools
• A user of CASE tools can draw a UML design diagram such as a class diagram,
collaboration diagram, or sequence diagram, and store the design blueprints in the
CASE data store.
• The biggest advantage of CASE tools is its centralized data with many supporting
software tools which can generate different products for different purposes based
on the same set of data.
Applicable domains of repository architecture:
• Suitable for large, complex information systems where many software component
clients need to access them in different ways
• Requires data transactions to drive the control flow of computation
Advantages
• Efficient way to share large amount of data
67
Advantages
• The data flow software architecture style views the entire software system as a
series of transformations on successive sets of data, where data and operations
on it are independent of each other.
• The software system is decomposed into data processing elements where data
directs and controls the order of data computation processing.
Data Flow Architectures
• Regardless of the type of topology, the data moves from one subsystem to
another.
• In general, there is no interaction between the modules except for the output and
the input data connections between subsystems.
Data Flow Architectures
• One subsystem can be substituted by another without affecting the rest of the
system
• Since each subsystem does not need to know the identity of any other subsystem,
modifiability and reusability are important property attributes of the data flow
architecture.
Pipes-and-Filters Style
Pipe and Filter
• This architecture decomposes the whole system into components of data source,
filters, pipes, and data sinks.
• The particular property attribute of the pipe and filter architecture is its concurrent
and incremented execution.
Pipes-and-Filters Style
• A component reads a stream of data on its input and produces stream of data at its
output.
Filter
• A filter does not even know the identity of data upstream or data
downstream.
• A filter is just working in a local incremental mode.
Active and Passive filters
• An active filter pulls in data and pushes out the transformed data (pull/push);
• A passive filter lets connected pipes push data in and pull data out.
Pipes
• Traditional Compilers:
• Compilation phases are pipelined, though the phases are not
always incremental. The phases in the pipeline include:
• lexical analysis + syntax analysis (parsing) + semantic analysis + code optimization +
code generation
Example:
Architecture of a Compiler
text code
Lex Syn Sem Opt CGen
Compiler
• A "semantic" analyzer reads the abstract syntax tree and writes an appropriately
augmented abstract syntax tree.
• A global optimizer (usually optionally invoked) reads an augmented syntax tree and
outputs one that is equivalent but corresponds to program that is more efficient in space
and time resource usage.
If the previous step generated symbolic assembly code, then an assembler is
needed to translate the sequence of symbolic instructions into a relocatable binary
module.
If the previous steps of the pipeline generated a sequence of separate binary
modules, then a linker might be needed to bind the separate modules with library
modules to form a single executable (i.e., object code) module.
The data format on the data streams is simple, stable, and adaptable if necessary.
Modifiability: It features low coupling between filters, less impact from adding
new filters, and modifying the implementation of any existing filters as long as
the I/O interfaces are unchanged.
Simplicity: It offers clear division between any two filters connected by a pipe.
Disadvantages