[go: up one dir, main page]

0% found this document useful (0 votes)
43 views6 pages

Unit 3 Architec Style

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 6

Introduction:

The software needs the architectural design to represents the design of software. IEEE
defines architectural design as “the process of defining a collection of hardware and
software components and their interfaces to establish the framework for the development of
a computer system.” The software that is built for computer-based systems can exhibit one
of these many architectural styles.
Each style will describe a system category that consists of :

 A set of components (eg: a database, computational modules) that will perform a


function required by the system.
 The set of connectors will help in coordination, communication, and cooperation
between the components.
 Conditions that how components can be integrated to form the system.
 Semantic models that help the designer to understand the overall properties of the
system.
The use of architectural styles is to establish a structure for all the components of the
system.

What is an Architectural Style?

An architectural style is a set of principles. You can think of it as a coarse-grained pattern that
provides an abstract framework for a family of systems. An architectural style improves
partitioning and promotes design reuse by providing solutions to frequently recurring
problems.

Benefits of Architectural Styles in Software Engineering

 Design Reuse. Well-understood solutions applied to new problems.


 Code reuse. Shared implementations of invariant aspects of a style.
 Understandability of system organization. A phrase such as ‘client-server”
conveys a lot of information.
 Interoperability. Supported by style standardization.
 Style-specific analysis. Enabled by the constrained design space.
 Visualizations. Style-specific descriptions matching engineer’s mental
models.

Architectural
Description
Style
Segregates the system into two applications, where the
Client-Server
client makes a service request to the server.
Decomposes application design into reusable
Component-Based functional or logical components that are location-
Architecture transparent and expose well-defined communication
interfaces.
Partitions the concerns of the application into stacked
Layered
groups (layers) such as presentation layer, business
Architecture
layer, data layer, and services layer.
A software system that can receive and send messages
that are based on a set of known formats, so that
Message-Bus
systems can communicate with each other without
needing to know the actual recipient.
Segregates functionality into separate segments in
much the same way as the layered style, but with each
N-tier/3-tier
segment being a tier located on a physically separate
computer.
An architectural style based on division of tasks for an
application or system into individual reusable and self-
Object-Oriented
sufficient objects, each containing the data and the
behavior relevant to the object.
Separates the logic for managing user interaction from
Separated
the user interface (UI) view and from the data with
Presentation
which the user works.
Refers to Applications that expose and consume
Service-Oriented
functionality as a service using contracts and
Architecture (SOA)
messages.

Layered architechture

Definitions

Software architecture refers to the basic structure of any software system and
incorporates any aspect that makes a system function and behaves as it should. Although the
term architecture usually refers to physical designs, in software systems, it encompasses the
design of components, relationships between components, user interactions, as as well as the
user’s needs of a system.
There are several different software architectures that exist such as
microkernels, microservices, and client-servers just to name a few. Each of these is structured
differently and is used in a different context. However, we’ll only look at layered
architectures in this article.

3. What Is a Layered Architecture?

Layered architectures are said to be the most common and widely used architectural
framework in software development. It is also known as an n-tier architecture and describes
an architectural pattern composed of several separate horizontal layers that function
together as a single unit of software. A layer is a logical separation of components or code:

In these frameworks, components that are related or that are similar are usually placed
on the same layers. However, each layer is different and contributes to a different part of the
overall system.
Characteristics

A major characteristic of this framework is that layers are only connected to the layers
directly below them. In the illustration given previously, layer 1 only connects to layer 2,
layer 2 connects to layer 3, and layer 1 is connected to layer 3 only through layer 2.
Another characteristic is the concept of layers of isolation. This means that layers can be
modified and the change won’t affect other layers. In short, changes are isolated to the
specific layer that is altered.
Separation of concerns is another notable feature that speaks to how the modules on a single
layer together perform a single function.

Components of a Layered Architecture

Now, the number of layers in a layered architecture is not set to a specific number and is
usually dependent on the developer or software architect. It is important to note that this
framework will usually always have a user interaction layer, a layer for processing, and a
layer that deals with data processing. These are described further as:

 Presentation Layer – responsible for user interactions with the software system
 Application/Business Layer – handles aspects related to accomplishing functional
requirements
 Domain Layer – responsible for algorithms, and programming components
 Infrastructure/Persistence/Database Layer – responsible for handling data,
databases

Additionally, in some applications, some layers are combined. For example, it is common to
find the business layer and persistence layer combined into a single layer. This just means
that the functions and responsibilities of these two layers have been grouped to occur at a
single layer.

5. Advantages and Disadvantages

The following are the benefits and drawbacks that exist with this software pattern:
Advantages

 The framework is simple and easy to learn and implement.


 There is reduced dependency because the function of each layer is separate from the
other layers.
 Testing is easier because of the separated components, each component can be tested
individually.
 Cost overheads are fairly low.

Disadvantages

 Scalability is difficult because the structure of the framework does not allow for
growth.
 They can be difficult to maintain. A change in a single layer can affect the entire
system because it operates as a single unit.
 There is interdependence between layers since a layer depends on the layer above it to
receive data.
 Parallel processing is not possible.

When to Use Layered Architectures

When developing simple, small applications, it is advisable to implement a layered


architecture because it’s the most simple framework. However, some developers are of the
opinion that because they can be difficult to maintain, it is better to apply them to larger
projects.
In spite of this, the framework can be used for applications that need to be built quickly
because it’s easy to learn and implement. It is also good in cases where the developers do not
have a lot of knowledge of software architectures or when they are undecided on which one
to use.
Some real-life applications of this architecture are in web applications and the OSI model.
The J2EE programming model also implements the layered architecture.
Client-Server Architecture

Client-Server Architecture is a layered architecture pattern that must include at least two
factors:
 A client sending requests to a server.
 A server that can respond to the client’s requests.

People use client-server architecture often without realizing it. For example, someone might
order a pizza on their smartphone. In this scenario, the person’s smartphone (the client) sends
a request to a pizza restaurant’s computer system (the server) to place an order.

In real-world applications, client-server architecture usually becomes much more complex


than this. Even in the provided example, the pizza restaurant doesn’t have an on-site server. It
probably relies on a cloud server to handle requests.

Since there are diverse, often complex versions of client-server architectural designs,
software engineering professionals refer to four types of client server architechture.
1-Tier Architecture

1-tier client-server patterns can include multiple settings that influence how applications
handle requests. When using 1-tier architecture in a professional setting, you would probably
add layers for business logic and data logic, among others. It’s a very flexible approach to
building software, so you can adapt it to meet unique needs.

While useful in many ways, 1-tier software design patterns tend to create a lot of data, which
means applications require significant, frequent management. When left unmanaged, data
variances will eventually corrupt the results and interfere with performance.

2-Tier Architecture

2-tier architecture is a very simple, straightforward pattern that only relies on a client and a
server. This approach works by installing any necessary database on the server’s side and the
user interface on the client’s device. In this scenario, “device” is used loosely because it can
refer to a web browser just as easily as hardware, such as a laptop computer.

In a simplified world, the pizza-ordering system uses 2-tier architecture without relying on
cloud servers or other networks.

3-Tier Architecture

3-tier adds an intermediary to the structure of 2-tier architecture. When the client submits a
request, it goes to middleware. The middleware passes the request to the server. Once
received, the server sends a response to the middleware, which passes it to the client.

Why add another layer? Users won’t notice it, but stakeholders can use the intermediary to
improve data control and security. Essentially, the middle layer acts like a filter that protects
the server from dangerous information, such as malware and potentially even Distributed
Denial-Of-Service (DDoS) Attacks.

N-Tier Architecture

N-tier architecture, also called multi-tier architecture, involves at least five tiers:

 Client
 Internet
 Server
 Middle
 Data

With n-tier architecture, a client’s request goes to the internet before it gets sent to a web
server (server tier). The web server sends the request to the middle tier, where it encounters
business logic that can augment the request to meet system standards. Finally, the request
goes to the database, which responds accordingly and sends a reply back through the tiers.
Alternatively, a tier between the client and server can deny the request or reply.

Pipe & Filter Architecture


Definition

Pipe and filter is a component based architectural style that allows for the deconstructing of
monolithic processes into small independent components consisting of Pumps, Filters, and a
Sink. Data is passed from pipes through a variety of filters, and ultimately ends up in the sink.

Vocabulary for components and connectors:

○ Pumps are the initial source of data which can be streamed or passed into an initial filter.

○ Filters are independent components that execute a specified task and do not share states
with otherfilters or components. Filters often have buffers to be able to queue work, but are
unaware oftheir upstream/downstream neighbours.

○ Sink or consumer is the target where the final output from a series of filters is collected.

Topological constraints

 Due to the nature of pipe and filter where data is passed through a variety of filters,
the design usually must form some uni-directional sequence where the structure lacks
cycles. This ensures that there is a clear defined workflow for data, and that the
application isn’t cycling back to previous filters
 Although there can be multiple pumps, it's often the case that the structure of pipe and
filter application only has one sink to aggregate processed information.
 Filters must not be aware of downstream/upstream providers. They must only
communicate through the main communication channels (input/output pipes).

You might also like