ModuleIII(Architectural Patterns and Tactis)
ModuleIII(Architectural Patterns and Tactis)
" | DirectDeposit
iter 2
FormatRejected
*EOT" Sting Records
lack for 2 sec and retry
\when-empiy = block for 20 sec and retry
when full = black for 2 see and retry
hen-ompty = block for 60 sac and retry
FIGURE 13.8 A UML diagram of a pipe-and-filter-based systemComponent-and-Connector Patterns
TABLE 13.4 Pipe-and-Filter Pattern Solution
Pipe-and-Filter Pattern
+ Solution
Overview
Elements
Relations
Constraints.
Weaknesses
Data is transformed from a system's external inputs to its external
outputs through a series of transformations performed by its filters
connected by pipes.
Filter, which is a component that transforms data read on its input
port(s) to data written on its output port(s). Filters can execute
concurrently with each other. Filters can incrementally transform
data; that is, they can start producing output as soon as they start
processing input. Important characteristics include processing rates,
input/output data formats, and the transformation executed by the
filter.
Pipe, which is a connector that conveys data from a filter’s output
port(s) to another filter’s input port(s). A pipe has a single source
for its input and a single target for its output. A pipe preserves the
sequence of data items, and it does not alter the data passing
through. Important characteristics include buffer size, protocol of
interaction, transmission speed, and format of the data that passes.
through a pipe.
‘The attachment relation associates the output of filters with the input
of pipes and vice versa.
Pipes connect filter output ports to filter input ports.
Connected filters must agree on the type of data being passed along
the connecting pipe.
Specializations of the pattern may restrict the association of
components to an acyclic graph or a linear sequence, sometimes
called a pipeline.
Other specializations may prescribe that components have certain
named ports, such as the stdin, stdout, and stderr ports of UNIX
filters.
‘The pipe-and-filter pattern is typically not a good choice for an
interactive system.
Having large numbers of independent filters can add substantial
amounts of computational overhead,
Pipe-and-filter systems may not be appropriate for long-running
computations.Component-and-Connector Patterns
Client-Server Pattern
+ Context: There are shared resources and services that large numbers of distributed clients
wish to access, and for which we wish to control access or quality of service.
+ Problem:
+ for modifiability and reuse, factor out common services and modify them in a single
location or small number of locations.
* for scalability and availability, centralize the control of these resources and services
while distributing the resources themselves across multiple physical servers.
* Solution
Bank AT™ AT™
transaction monitoring reconfiguration
‘Guthorizer Server Server
Monitoring
Station
Fieconfigure
and update |
process program,
Key: “er cocker connestor with
hone Sonet cliont and server pores
ea Ex a=.
FIGURE 13.9 The client-server architecture of an ATM banking systemComponent-and-Connector Patterns
Client-Server Pattern
+ Solution TABLE 13.5 Client-Server Pattern Solution
Overview
Elements
Relations
Constraints
Weaknesses
Clients initiate interactions with servers, invoking services as
needed from those servers and waiting for the results of those
requests.
Client, a component that invokes services of a server
component. Clients have ports that describe the services they
require.
Server, a component that provides services to clients. Servers
have ports that describe the services they provide, Important
characteristics include intormation about the nature of the
server ports (such as how many clients can connect) and
performance characteristics (e.g., maximum rates of service
invocation)
Request/reply connector, a data connector employing a
request/reply protocol, used by a client to invoke services on a
server. Important characteristics include whether the calls are
local or remote, and whether data is encrypted.
The attachment relation associates clients with servers.
Clients are connected to servers through request/reply
connectors.
‘Server components can be clients to other servers.
Specializations may impose restrictions:
= Numbers of attachments to a given port
+ Allowed relations among servers
Components may be arranged in tiers, which are logical
groupings of related functionality or functionality that will share
@ host computing environment (covered more later in this
chapter).
Server can be a performance bottleneck.
Server can be a single point of failure.
Decisions about where to locate functionality (in the client or
in the server) are often complex and costly to change after a
system has been built.Component-and-Connector Patterns
Peer-to-Peer Pattern
+ Context: Distributed computing entities with independent resources need to cooperate and
collaborate to provide a service to a distributed community of users.
+ Problem: How can a set of “equal” distributed computing entities be connected to each other
via a common protocol, so that they can organize and share their services with high availability
and scalability?
* Solution
—
‘
moldy
69.95.6349
naboo
15766 24.26
—
“
Key!) teat poor im ruta port
Utrapecr
@--@
Requestepiy using Gnutella
protocol over TCP or UDP
HTTP fie tranctor
FIGURE 13.10 A peer-to-peer view of a Gnutella network using an Informal C&C.
notation. For brevity, only @ few peers are identified. Each of the identified leaf
peers uploads and downloads files directly from other peers.+ Solution
Component-and-Connector Patterns
Peer-to-Peer Pattern
TABLE 13.6 Peer-to-Peer Pattern Solution
Overview
Elements
Relations
Constraints
Weaknesses
Computation is achieved by cooperating peers that request service
from and provide services to one another across a network
Peer, which is an independent component running on a network
node. Special peer components can provide routing, indexing, and
peer search capability
Request/reply connector, which is used to connect to the peer
network, search for other peers, and invoke services from other
peers. In some cases, the need for a reply is done away with
The relation associates peers with their connectors. Attachments
may change at runtime.
Restrictions may be placed on the following:
"The number of allowable attachments to any given peer
= The number of hops used for searching for a peer
= Which peers know about which other peers
‘Some P2P networks are organized with star topologies, in which
peers only connect to supernodes
Managing security, data consistency, data/service availability,
backup, and recovery are all more complex.
Small peer-to-peer systems may not be able to consistently achieve
quality goals such as performance and availability.Component-and-Connector Patterns
Service-Oriented Architecture Pattern
+ Context: A number of services are offered (and described) by service providers and
consumed by service consumers. Service consumers need to be able to understand and use
these services without any detailed knowledge of their implementation.
+ Problem:
+ To support interoperability of distributed components running on different platforms and
written in different implementation languages, provided by different organizations, and
distributed across the internet.
* To locate services and combine (and dynamically recombine) them into meaningful
coalitions while achieving reasonable performance, security, and availability.
* Solution
fey
Chae —> imPnres
peen
Seni —> wal
‘ppeaten
— dense
[a Eee
sever "1
— Wensenees| a
ooo S| | plot pa
‘ai be =l acampeet
soy
FIGURE 13:11 Diagram ofthe SOA view for the Adventure Buder system, OPC
stands or"Order Processing Cente”Component-and-Connector Patterns
Service-Oriented Architecture Pattern
+ Solution
TABLE 137 Service-Oriented Architecture Pattern Solution
Overview __Computationis achieved by ast of cooperating components
that provide and/or consume services over a network. The
computatonis often desorived usin a workow language,
Elements ‘Components:
‘Service providers, which provide one or more services
through published interfaces. Concems are often tied to
the chosen implementation technology, and include perfor.
mance, authorization constants, avaiablty, and cost. In
some cases these properties ae specifiedin a service-level yatnng
agreement
Service consumers, which invoke services directly or through
anintermeciary.
‘Service providers may aso be sarvice consumers.
ESB, which is an intermediary element that can route and
‘transform messages between service providers and consum-
as, Weaknesses
"Registry of services, which may be used by providers to
register tei services and by consumers to discover senvioes
atruntime.
Orchestration server, which coordinates the interactions
between senice consumers and providers based on
languages for business processes and wordfons.
Connectors:
"SOAP connector, whch uses the SOAP protocol fo
‘synchronous communication between webservices, tpicaly
ver HTTP,
"REST connector which relies onthe basic requesteg\y
pertions ofthe HTTP protocol
"Asynchronous messaging connector, which uses &
‘messaging system to fet point-o-point or pubish-subserbe
asynchronous message exchanges
‘Atachment ofthe diferent kinds of components avalabe to the
respective comectrs
‘Service consumers are connected to service providers, but
intermediary components (2.9, ESB, registry, orcheshaton
server maybe used.
‘S0A-tased systems are typically complex io buid
‘Youdor’tcontl he evolution of independent serves.
‘Thete sa performance overiead associated wit he
middleware, and services may be performance botnets, and
‘ypicaly do not provide perormance guarantees,Component-and-Connector Patterns
Publish-Subscript Pattern
+ Context: There are a number of independent producers and consumers of data that must
interact. The precise number and nature of the data producers and consumers are not
predetermined or fixed, nor is the data that they share.
* Problem: To create integration mechanisms that support the ability to transmit messages
among the producers and consumers in such a way that they are unaware if each other’s
identity, or potentially even their existence.
* Solution Register
Bee (a -
— 5 of reat he
, ss
sips Ul evnt manager
Uren, [TT ection pa
mre Sew Ltacace) seem”
Key:
Be @8e" Ose — hehe Component
Map instance /| Co
= on
| | Oaks
FIGURE 13.14 A component-and-connector view of map-reduce showing how the
data processed by map is partitioned and subsequently processed by reduceAllocation/C&C Patterns
Map-Reduce Pattern Solution
Map-Reduce Pattern
* Solution TABLE 13.10
Overview
Elements,
Relations
Constraints
Weaknesses
‘The map-reduce pattern provides a framework for analyzing a
large distributed set of data that will execute in parallel, on a set
of processors. This parallelization allows for low latency and high
availability. The map performs the extract and transform portions
of the analysis and the reduce performs the /oading of the results.
(Extract-transform-load is sometimes used to describe the functions of
the map and reduce.)
Maps a function with multiple instances deployed across multiple
processors that performs the extract and transformation portions of
the analysis.
Reduce is a function that may be deployed as a single instance or as
multiple instances across processors to perform the load portion of
extract-transform-load,
The infrastructure is the framework responsible for deploying map and
reduce instances, shepherding the data between them, and detecting
and recovering from failure.
Deploy onis the relation between an instance of a map or reduce
function and the processor onto which it is installed.
Instantiate, monitor, and controls the relation between the
infrastructure and the instances of map and reduce.
The data to be analyzed must exist as a set of files.
‘The map functions are stateless and do not communicate with each
other.
The only communication between the map instances and the reduce
instances is the data emitted from the map instances as