0% found this document useful (0 votes)
35 views17 pages

Architectural Styles

The document outlines various architectural styles including Layered, Pipe and Filter, Event Driven, Client-Server, N-tier, Object-Oriented, Data-Centered, and Process-Control architectures. Each style is described with its advantages and disadvantages, emphasizing their applications and how they manage system functionality and data. The document serves as a comprehensive guide to understanding these architectural frameworks in software design.

Uploaded by

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

Architectural Styles

The document outlines various architectural styles including Layered, Pipe and Filter, Event Driven, Client-Server, N-tier, Object-Oriented, Data-Centered, and Process-Control architectures. Each style is described with its advantages and disadvantages, emphasizing their applications and how they manage system functionality and data. The document serves as a comprehensive guide to understanding these architectural frameworks in software design.

Uploaded by

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

Common Architectural Styles

1. Layered architecture:

 The most simple and certainly most known architecture style of is the
layered architecture style.

 There are many examples of the layered patterns applied to IT industry


such as the OSI model consisting of 7 layers describing network
architecture.

 The concept is simple, each layers only interact with the layer below it
and delivers services for the layer immediately above.

 When implemented correctly the upper layers can concentrate on


implementing functions needed by its users (eg. business functions) and
relay on lower layers to handle the more basic system needs (eg.
infrastructure functions).

 A classical example of a layered architecture is the following:

Example of layered architectural style.

 In this diagram, the user interface layer, responsible for displaying


information and handling interaction is using services from the business
layer who is responsible with performing actual system functions. The
business layer is using services on its own from the data layer who is
responsible with storing and retrieving data.

Advantage:

 The main advantage of layers is the stratification of concerns that are


implemented in a system, making each layer perform a certain area of
functions makes the system more simple to understand and easier to
maintain.
 Lower complexity and better maintainability.

Disadvantage:

A disadvantage of using this style is the decrease of performance because each


call that comes from the upper layer must transit all the underneath layers.

Example of a call crossing all the layers.

Conclusion:

 You must balance the advantages and disadvantages of using this style
and use it when appropriate. Sometimes, for performance reasons, the
calls from an upper layer jumps over an intermediate layer and calls
directly a lower layer, to boost the performance.

Example of jumping over layers


2. Pipe and filter architecture
 One of the oldest styles of architecture recognized as such is the pipes
and filters architecture.

 This style uses processing components that output same kind of data,
named filters, and connections between these components, named pipes.

 The processing is done by each component using data received through


the pipe from the previous component. The filter processing can
eventually be done concurrently, as data from a previous filter become
available.

Pi Pi
p p
Filter e Filter e Filter

Pi Pi
p p
e e

Filter
Pi
p
e
 A very well known system build using this architecture is the Unix
command lines but other domains can use this style as well.

 In the diagram below is an example of an image processing system for


noise reduction composed of 3 filters:

Example of pipes and filters architecture style

 The clock stereotype from the image above denotes a real-time


component; this enforces the idea that the style can be applied to very
different systems.

 Each component receive some data from the its inbound pipe, processes
the data and sends the result to the outbound pipe.
 The components can then be combined in new and ingenious ways
reusing much of the existing work. For example, replacing the last filter
with a “Noise enhancer” component the result is completely different
output

Advantage:

 The main advantage of this style is that complex systems can be build by
combining simple components.

 They allow the designer to understand the overall input/output behaviour


of a system as a simple composition of the behaviours of the individual
filters.

 They support reuse: any two filters can be hooked together, provided they
agree on the data that is being transmitted between them.

 Systems can be easily maintained and enhanced: new filters can be added
to existing systems and old filters can be replaced by improved ones.

 They permit certain kinds of specialized analysis, such as throughput and


deadlock analysis.

 They naturally support concurrent execution. Each filter can be


implemented as a separate task and potentially executed in parallel with
other filters.

Disadvantages:

 Pipe and filter systems often lead to a batch organization of processing. Although
filters can process data incrementally, since filters are inherently independent, the
designer is forced to think of each filter as providing a complete transformation of
input data to output data.

 In particular, because of their transformational character, pipe and filter systems are
typically not good at handling interactive applications like when incremental display
updates are required.

 They may be hampered by having to maintain correspondences between two separate,


but related streams.

 Depending on the implementation, they may force a lowest common denominator on


data transmission, resulting in added work for each filter to parse and unparse its data.
This, in turn, can lead both to loss of performance and to increased complexity in
writing the filters themselves.

 Can’t coordinate stream inputs.


3. Event driven architecture

 In event driven architecture the components are completely unaware of


the communication end points. Communication is handled by a special
component at infrastructure level.
 This might be seen as an evolution of the publisher-subscriber where
instead of registering with a subscriber a component is just receiving all or
a filtered set of messages from any component that is using the same
infrastructure.

Event driven architecture style

 The events are sends by a component usually without a determined end


point, and any component interested in the type of event can receive
it together with the attached data.

Advantages:

 There are many advantages of this approach like the possibility of adding
and removing components without a huge impact on the system
 Easy component relocation.
 Possibility to extend the messages without impacting the components that
are not yet ‘upgraded’ and so on.
 Of course this does not come for free, using this kind of architecture is not
something some can add later but it must be constructed from
the beginning.

Disadvantages:

 The Enterprise Service Bus off the shelf components try to mimic this
model at a higher level and with the promise
of interconnecting components that were not specifically constructed to
work in a service oriented architecture.
 Complexity.
 Tendency for hub-and-spoke architectures
 Performance issues for high throughput systems.
4. Client Server architecture style:
 The client server architecture style become very well known when the
explosion of internet brought it to common vocabulary.
 On the internet, a browser (client) responsible with user interaction
connects to a web portal (server) responsible with data processing and
HTML formatting.
 There are many examples of client-server architectures and initially it
appeared as a result of the need to centralize processing and data to a
common location and allow changes of the system to be implemented
without modifying the whole system.
 In a system composed only of desktop clients any modification
would presumably require redeployment of all clients, a operation
that incurred high costs.

Client server architecture style

Other variations on the client/server style include:

 Client-Queue-Client systems. This approach allows clients to


communicate with other clients through a server-based queue. Clients can
read data from and send data to a server that acts simply as a queue to
store the data. This allows clients to distribute and synchronize files and
information. This is sometimes known as a passive queue architecture.
 Peer-to-Peer (P2P) applications. Developed from the Client-Queue-Client
style, the P2P style allows the client and server to swap their roles in order
to distribute and synchronize files and information across multiple clients. It
extends the client/server style through multiple responses to requests,
shared data, resource discovery, and resilience to removal of peers.
 Application servers. A specialized architectural style where the server
hosts and executes applications and services that a thin client accesses
through a browser or specialized client installed software. An example is a
client executing an application that runs on the server through a framework
such as Terminal Services.

Advantages:
 Higher security. All data is stored on the server, which generally offers a
greater control of security than client machines.
 Centralized data access. Because data is stored only on the server,
access and updates to the data are far easier to administer than in other
architectural styles.
 Ease of maintenance. Roles and responsibilities of a computing system
are distributed among several servers that are known to each other through
a network. This ensures that a client remains unaware and unaffected by a
server repair, upgrade, or relocation.

Disadvantages:

 It is not easy to balance the amount of functionality implemented on


the server with the ones implemented on client because of the
conflicting needs and requirements. For example you would want more
processing on client when a fast user interface is desirable but you also
want as much processing done on the server so that changes are more
easily deployed. The web browser clients, are traditionally thin clients
where little or no processing is done except displaying server formatted
pages and sending input. But, lately there is a grown tendency to add
more processing on the clients, HTML being an example of this trend.
 Another aspect that is hard to balance is the amount of data exchanged
between the client and the server.
 You would want very little data transmitted for performance reasons but
however the users might demand a lot of additional information.
5. N-tier architecture
 N-tier architecture style can be seen as a generalization of the client-
server architecture.

 The style appeared as a result of the need to place system functionality


onto more than one processing node.

 This style of architecture is supported naturally by the layered architecture


and more often than not there is confusion between n-tier and n-layer
architectures.

 As a rule of thumb tier refers to processing nodes while layers refers to the
stratification of system functionality.

 The diagram below is a classical example of a n-tier architecture:

 As with layered architecture you need to make a decision regarding the


number of tiers balancing the performance, separation of concerns,
deployment complexity, hardware etc.

N-tier architecture style example


6. Object-Oriented Architectural Style

 Object-oriented architecture is a design paradigm based on the division of


responsibilities for an application or system into individual reusable and
self-sufficient objects, each containing the data and the behaviour
relevant to the object.

 An object-oriented design views a system as a series of cooperating


objects, instead of a set of routines or procedural instructions.

 Objects are discrete, independent, and loosely coupled; they communicate


through interfaces, by calling methods or accessing properties in other
objects, and by sending and receiving messages.

 The key principles of the object-oriented architectural style are:


o Abstraction:. This allows you to reduce a complex operation into
a generalization that retains the base characteristics of the
operation. For example, an abstract interface can be a well-known
definition that supports data access operations using simple
methods such as Get and Update. Another form of abstraction
could be metadata used to provide a mapping between two
formats that hold structured data.
o Composition:. Objects can be assembled from other objects, and
can choose to hide these internal objects from other classes or
expose them as simple interfaces.
o Inheritance:. Objects can inherit from other objects, and use
functionality in the base object or override it to implement new
behavior. Moreover, inheritance makes maintenance and updates
easier, as changes to the base object are propagated
automatically to the inheriting objects.
o Encapsulation:. Objects expose functionality only through
methods, properties, and events, and hide the internal details such
as state and variables from other objects. This makes it easier to
update or replace objects, as long as their interfaces are
compatible, without affecting other objects and code.
o Polymorphism:. This allows you to override the behavior of a
base type that supports operations in your application by
implementing new types that are interchangeable with the existing
object.
o Decoupling:. Objects can be decoupled from the consumer by
defining an abstract interface that the object implements and the
consumer can understand. This allows you to provide alternative
implementations without affecting consumers of the interface.

 Common uses of the object-oriented style include defining an object model


that supports complex scientific or financial operations, and defining objects
that represent real world artifacts within a business domain (such as a
customer or an order). The latter is a process commonly implemented using
the more specialized domain driven design style, which takes advantage of
the principles of the object-oriented style.
Advantages:

 Understandable. It maps the application more closely to the real world


objects, making it more understandable.
 Reusable. It provides for reusability through polymorphism and
abstraction.
 Testable. It provides for improved testability through encapsulation.
 Extensible. Encapsulation, polymorphism, and abstraction ensure that a
change in the representation of data does not affect the interfaces that
the object exposes, which would limit the capability to communicate and
interact with other objects.
 Highly Cohesive. By locating only related methods and features in an
object, and using different objects for different sets of features, you can
achieve a high level of cohesion.

Conclusion:

Consider the object-oriented architectural style if you want to model your


application based on real world objects and actions, or you already have suitable
objects and classes that match the design and operational requirements. The
object-oriented style is also suitable if you must encapsulate logic and data
together in reusable components or you have complex business logic that
requires abstraction and dynamic behaviour.
Virtual machine

 A virtual machine implements an instruction set for an


imaginary machine.

 Often virtual machines are the underlaying mechanism by which


a programming language is executed.

 E.g. Java virtual machine, different interpreters.

 Specifies an interface between compiler and a real machine.

 From conceptual point of view very similar to OS.

 Improves portability
7. Data centered architecture
 These architectures have the goal of achieving the quality of integrability
of data.

 The term refers to systems in which the access and update of a


widely accessed data store is their primary goal.

 Basically, it is nothing more than a centralized data store that


communicates with
a number of clients.

 Important for these styles are three protocols: communication,


data definition and data manipulation protocol.

 The means of communication distinguishes the two subtypes: repository and


blackboard.

 Repository: a client sends a request to the system to perform a necessary action


(e.g. insert data).

 Blackboard: the system sends notification and data to subscribers when data of
interest changes, and is thus active.

Repository architecture

Repository architecture
 One of the most well-known examples of the data-centered architecture,
is a database architecture ,There is a common database schema (i.e.
meta-structure of the repository) -created with data definition protocol
e.g. in RDBMS a set of related tables with fields, data types, keys, ...

 Clients use data manipulation protocol to work with the data e.g. SQL for
inserting, selecting, deleteing data, ...

 Depending on where clients are situated communication protocol might


be an inner-proces communication.

 Communication between components on the same machine


Communication over network, e.g. LAN, Internet, etc.

 Another example of data-centered architectures is the Web architecture There is a common


data schema (i.e. meta-structure of the Web) ,it follows hypermedia data model.

 Pages (nodes) and links between them, as well as addressing mechanism

Advantages:

 Ensures data integrity.


 Reliable, secure, testability guaranteed.
 Clients independent on the system: performance and usability on the client
side is good.
 Problems with scalability.
 Solutions: shared repositories, replication but this increases
complexity.
Process-Control Architecture Style

• Suitable for applications whose purpose is to maintain specified properties of


the outputs of the process at sufficiently near given reference values.

 Here the main Components are


o Process definition: which include includes mechanisms for
manipulating some process variable.
o Control algorithm: for deciding how to manipulate process variables.
o
 Connectors are the data flow relations for Process Variables, Set point, and
Sensors.

 Before starting with this architectural style let’s see some fundamental
concept in it.
A. Process variable:
Properties of process that can be measured. Example: designated input
and control variable in hot air furnace system.
B. Controlled variable:
Process variable whose value the system is intended to control. Example:
Hot air in hot air furnace system.
C. Input variable: Process variable that measure input to the process.
Example: Return air temperature in hot air furnace system.
D. Manipulated variable: Process variable whose value can be changed by
the controller. Example: Hot air in hot air furnace system.
E. Set point: The desired value for controlled variable. Example: thermostat
setting.

 General view of process control system is shown below.

Process control system

 Process control system are broadly categories into two broad categories they
are.
A. Open loop control system.
B. Closed loop control system.

A. Open loop control system:


 If the input material is pure, if the process is fully defined, and if operation
is completely repeatable, the process can be simply run without
surveillance. Such process is called open loop system.
 The given figure shows the such system where the system uses hot air to
raise the temperature of air.
Ref fig: 2.8 in Mary show open loop temperature control.

 The open system is rarely valid for the physical process in the real world.

B. Closed loop process controlled system:


 If the property of controlled variable likes temperature, pressure and flow
rate are monitored and there values are used to control the process by
changing the setting of apparatus such as valves, heater, and chillers.
Such systems are called closed loop system.
 Home thermostat is common example: where the temperature at the
thermostat is measured and furnace is turn on and off as necessary to
maintain the desired temperature.
 The below diagram show the example of closed loop system.
Ref Mary show 2.9 fig Closed loop temperature control
 Again there are two general form of closed-loop system.
a. Feed back control system.
b. Feed forward control system.

a. Feedback control:
 The main component of feedback control system is Process definition,
process variable, a sensor, the set point and control algorithm.
 The general view of feedback control is given below.
 The controlled variable is measured and the result is used to manipulate
one or more of the process variables.

Feedback control loop

Feedforward control loop:


 The important component of feedforword controller is essentially the
same as for a feedback control except that the sensor obtains value of
input or intermediate variable. It is valuable when lags in process
delay the effect of control changes.

Feedforword control system

You might also like