Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

SOFTWARE DESIGN AND ARCHITECTURE

Assignment number # 1

Name: Syeda Momena Nadeem


Roll Number: Fall 2021/ BSSE-D/ 118
SumbittedTo: Sir Zubair

Department Of Software Engineering


Lahore Garrison University
In software architecture, patterns refer to different approaches to organizing and
designing the structure of software systems. Software developers can use these
patterns and styles to create software that is more maintainable, scalable, and
resilient by providing reusable solutions to commonly occurring problems in
software design.
The following are some architectural design and patterns:-

1) Client-Server Architectural Pattern:-


Client-server architecture is one of the most popular architectural patterns in
software development today. This software is divided into two main parts i.e. the
client and the server
Clients interact with users and present information in a user-friendly manner,
typically as the interfaces to the system to which they belong
On the other hand, the server processes and stores data as well as executes business
logic.
This architecture involves the client sending requests to the
server, which processes them and returns responses to the client. Communication
between clients and servers is accomplished through networks, such as the internet,
intranets, or local networks.

Diagram:-
Usage:-
In web applications, database systems, and e-mail systems, this pattern is often
used to separate the presentation layer (client) from the business logic layer
(server).

Advantages:-
 Client-server architecture can enhance system performance by enabling the
server to handle data processing and business logic, while leaving the client
to handle user interfaces and presentations.
 The model is highly efficient when it comes to providing resources to the
client and has a low maintenance cost as well.
 The client-server architecture provides backup and recovery options,
increasing the system's reliability. If the server fails, it can restore the system
to its previous state.
 Compared to client devices, servers are more efficient at handling resource-
intensive tasks because they are optimized.
 Client-server architecture facilitates easy scaling of the system by adding
more servers to handle increased client demand.
 Managing resources and providing services is handled by the server, which
makes centralized management and control easier.
 Only authorized users can access resources and services with a dedicated
server handling authentication and authorization.
 Client device failures or network disruptions are less likely to result in data
loss or corruption on a dedicated server responsible for managing resources
and providing services.

Disadvantages:-
 Clients may not be able to access resources or services if the server fails or
becomes overloaded.
 It can be expensive to set up and maintain a server, and as the system grows,
more resources may be required, leading to additional costs.
 It is important to note that the client-server pattern relies on a network
connection. An unreliable or slow connection can have an adverse impact on
the performance and availability of the system.
 Whenever a server is compromised, sensitive data or resources can be
exposed because of its centralized nature.
 As the server manages resources and provides services, adding new
functionality or customizing the system to meet client needs can be
challenging without modifying the server.

Example:-
Examples of computer applications that use the client–server model are Email,
network printing, and the World Wide Web. Protocols: The special set of rules that
end points in a telecommunication connection use when they communicate.
Examples: TCP/IP, HTTP, FTP and etc.

2) Layered Architectural Pattern:-


The most common architecture pattern is a layered one, also known as an n-tier
pattern. Layered architecture is composed of horizontal layers, with each layer
performing a particular function. Large-scale systems can benefit from this pattern,
which is widely used in enterprise applications. It is usually organized in a
hierarchical manner, where each layer interacts with its immediate neighbors.
There is no coupling between the layers, so changes in one layer do not affect
changes in the others.
The most common layers used in the layered architectural pattern are:-
 Presentation Layer:
It is the highest layer of the software that is responsible for presenting information.
User interfaces are located here. Data presentation logic and the CRUD (Create,
Read, Update, Delete) operations flow are all contained in this section. User
interaction and user interface are handled by this layer. It is the layer that is
directly visible to the user and with which he or she interacts. It usually comprises
buttons, menus, and forms that make up the user interface.

 Business Layer:-
A business layer contains the business logic of a system in a layered architectural
pattern. The domain layer or service layer may also be referred to as the
application layer. Logic and rules of the system are performed by this layer. The
presentation layer is an intermediary between the data layer and the presentation
layer. User requests are processed by the business layer and transformed into
actions that the system can perform. A system's behavior is governed by its rules
and policies. As well as calculating, validating, and transforming data, it also
performs complex calculations.
 Persistence Layer:-
The persistence layer, also known as the data access layer, is an important layer in
the layered architectural pattern, providing an abstraction over the database and
facilitating the separation of concerns between the business logic and data storage,
improving the overall maintainability, scalability, and flexibility of the system. The
persistence layer is a layer in the layered architectural pattern that manages the
storage and retrieval of data. It provides a separation of concerns between business
logic and data storage, making it easier to modify the database schema and
improve overall performance.

 Database Layer:-
In layered architectures, the database layer, also called the data storage layer, stores
and retrieves data from databases. An example of such a layer would be a database
management system (DBMS) and the tools associated with it. A database layer is
responsible for creating and managing a database's schema, storing and retrieving
data, and enforcing data integrity constraints such as unique keys and foreign keys.
A SQL query language or other query language is also provided for querying the
database.

Diagram:-
Usage:-
Layered architectures are useful when developing simple, small applications since
they are the simplest frameworks. Many developers, however, believe that they
should only be used in large projects, due to their difficulty in maintaining. As a
whole, layered architectures are flexible and effective ways of structuring software
systems, especially complicated or large ones.

Advantages:-
 There is no complexity to the framework and it is easy to learn and
implement.
 In this system, each layer differs from the next in terms of function and
therefore there is a reduced dependency.
 The separated components make testing easier, since each component can be
tested independently.
 There are relatively few overhead costs.
 Layers are easily modified or replaced without impacting the rest of the
system due to their layered pattern. The maintainability will improve and
adding new features or fixing bugs will be easier.
 There is a separation of concerns between layers because each is responsible
for a specific set of tasks. This reduces the complexity of individual
components and makes the code easier to understand.
 It is easier to add more instances of a layer, or to add new layers, to scale the
system horizontally or vertically.
 Using layers in different projects can reduce development costs and time as
well as reuse them throughout the system.

Disadvantages:-
 A framework's structure does not allow for growth, which makes scalability
difficult.
 There can be a lot of work involved in maintaining them. The entire system
is affected by changes in a single layer, since it operates as a whole.
 The layer above it receives data from the layer above, which leads to
interdependence between them.
 There is no possibility of parallel processing.
 It is sometimes necessary to pass data and requests between layers, as the
layered pattern can cause overhead in performance. A system with many
layers may experience slower response times as a result.
 It can be difficult to modify the system when there is a strict separation
between layers. When one layer is modified, other layers may need to be
modified as well, which can be time-consuming and error-prone.
 A layered system can be complex due to the additional code and potential
points of failure created by each layer. System maintenance and
understanding can be difficult as a result.
 Layer separation can also make communication between different parts of
the system more difficult. As a result, the development process may take
longer and errors may occur.

Example:-
 OSI (Open Systems Interconnection) model: The OSI model is a layered
architecture used in computer networks to standardize communication
between different systems. It consists of seven layers, each with a
specific set of functions.
 Gmail is divided into at least three layers, every one of them has a
mission, and they exist separately to handle different processes at
different levels. It is an excellent example of a layered architecture.

3) Pipe and Filter Architectural Pattern:-


A pipe-and-filter architectural pattern consists of independent entities, called filters
(components), that perform transformations on data and process the input they
receive, as well as pipes, which serve as connectors for data streams being
transformed, connecting each component to the next.

Diagram:-
Usage:-
The pipe and the filter architectural is commonly used in various software systems
such as data processing systems, Signal processing applications, Multimedia
processing, batch processing systems etc. The Pipe & Filter architecture is an
effective way of structuring systems that process large volumes of data. It
simplifies the development and maintenance of complex systems by promoting
modularity and separation of concerns.

Advantages:-
 The filter allows designers to understand how an input/output system
works.
 It is possible to implement each filter individually and to execute each
filter in parallel with another
 Due to the intuitive flow of processing, it is suitable for processes that
require clear, systematic steps in order to transform successive pieces of
data
 If both the data input and the data output are the same, then filters can be
modified easily
 The flow of processing can be easily changed by introducing new filters,
or by replacing existing filters. As long as the data input and output
between filters are compatible, filters are reusable.
 The same filters can be used in many different parts of the system or even
in different projects, which reduces the amount of time and money spent
on development.
 As more instances of the filter are added, or as new filters are added to
the pipeline, the system scales horizontally.
 Large data processing applications can benefit from the Pipe & Filter
pattern. The fact that each filter processes data independently enables
them to run in parallel, which enhances the performance of the overall
process.
 A system can be debugged and maintained more easily if each filter can
be tested independently.
Disadvantages:-
 Data must be passed from one component to another throughout the
whole pipe and filter system, since not all components require the same
set of data
 Loss of data between components can affect reliability
 When your application has too many filters, bottlenecks or deadlocks are
likely to occur if one of the filters does not work or is slow to process
 Data is typically processed sequentially using a pipe and filter
architecture, which means filters are applied sequentially. As a result,
modifying the processing flow or introducing new filters may not be easy
without a lot of changes to the overall architecture.
 In this architecture, data is typically processed in batches instead of in
real time, where data is processed in batches rather than in realtime.
Streaming high-speed data or real-time analytics may be inconvenient for
this application.
 Using pipes to move data between filters may introduce overhead such as
data copying, serialization, and deserialization, which can reduce
performance, especially for large sets of data. It is important to keep this
overhead in mind when designing and optimizing, but it can be mitigated
with careful design and optimization.
 When errors occur in any of the filters, handling them can be complex in
a pipe and filter architecture. Errors may propagate through the filters,
leading to complex error handling and recovery mechanisms. This can
add complexity to the overall system design and make error handling
more challenging.

Example:-
Audio and video processing:
Audio and video processing is another example of pipe and filter architecture. A
series of filters can be applied to audio or video data to enhance or modify the
audio or video.
4) MVC Architectural Pattern
The model-view-controller (MVC) pattern is a method for developing user
interfaces in which the related program logic is divided into three separate pieces.
The Model-View-Controller (MVC) is an architectural pattern that separates an
application into three main logical components: the model, the view, and the
controller. Each of these components are built to handle specific development
aspects of an application.
1. Model:-
The business logic and data are represented by this component. As the data
manager, it handles data and provides necessary operations and behaviors to
manipulate it.
2. View:-
The user interface of the application is represented by this component. This
component displays data and interacts with the user.
3. Controller:-
Models and views are interconnected by the controller. User input is received from
the View, processed, and updated in the Model and View.

Diagram:-
Usage:-
Car driving mechanism is another example of the MVC model. Every car consist
of three main parts. View= User interface: (Gear lever, panels, steering wheel,
brake, etc.)

Advantages:-
 It is easier to manage and modify an application with the MVC architecture
because it separates the components into distinct modules. Separating
concerns also improves maintainability, reusability, and testability.
 In MVC architecture, different components of your application are separated
to promote code reuse. By reusing models and controllers across views,
developers are able to reduce duplication of code.
 Different development scenarios can be accommodated by the MVC
architecture. A variety of applications can be developed with it, including
web applications, desktop and mobile applications, games, and enterprise
applications.
 Developers can easily collaborate on the same project thanks to the MVC
architecture. It is possible to work on different components independently of
each other since each component is independent.
 MVC separates user interfaces from business logic, making it easier to
implement responsive and interactive interfaces. In turn, this improves the
user experience.
 In MVC architecture, concerns are separated and modules are grouped,
making code maintenance easier. The application is less likely to break if
one component is changed without affecting the others.

Disadvantages:-
 The MVC architecture can be challenging for novice developers, particularly
for those who are new to the field. Maintaining clear boundaries between the
model, view, and controller can be challenging when using separation of
concerns.
 As a result of the additional code and layers involved in MVC, it can take
more time to develop than other architectures. As a result, development
cycles may take longer and costs may increase.
 Due to the number of files and code required by MVC, file sizes and loading
times may increase compared to other architectures.
 If you have been using different development patterns, it may be challenging
for you to learn and understand MVC.
 An application can be over engineered using MVC, leading to unnecessary
complexity and development time.

Example:-
Car driving mechanism is an example of the MVC model.
Every car consist of three main parts.
View= User interface : (Gear lever, panels, steering wheel, brake, etc.)
Controller- Mechanism (Engine)
Model- Storage (Petrol or Diesel tank)
Car runs from engine take fuel from storage, but it runs only using mentioned user
interface devices.

5. Blackboard Architectural Style:-


Blackboard architecture style is an artificial intelligence approach which handles
complex problem, where the solution is the sum of its parts. In this architecture, the
logical flow is determined by the current data status in data store because the data
store is active and its clients are passive.

Diagram:-

Usage:-
Blackboard architecture style has a blackboard component which acts as a central
data repository. It is used in location-locomotion, data interpretation and
environmental changes for solving the problem. It is an approach to processing
agent communication centrally
Advantages:-
 Provides data integrity, backup and restore features.
 Provides scalability and reusability of agents as they do not have direct
communication with each other.
 Reduces overhead of transient data between software components .

Disadvantages:-
 It is more vulnerable to failure and data replication or duplication is possible.
 High dependency between data structure of data store and its agents.
 Changes in data structure highly affect the clients.
 Evolution of data is difficult and expensive.
 Cost of moving data on network for distributed data.

Example:-
Blackboard systems are used routinely in many military C4ISTAR systems for
detecting and tracking objects

6.Hierarchical Architectural Style:-


Hierarchical architecture views the whole system as a hierarchy structure, in which
the software system is decomposed into logical modules or subsystems at different
levels in the hierarchy. This approach is typically used in designing system
software such as network protocols and operating systems.
Diagram:-
Usage:-
Hierarchical Architectural Style used in designing system software such as
network protocols and operating systems.

Advantages:-
 When there exists enough diverse sources of input and knowledge, allows
for efficient managing of resources across a distributed network.
 Allows for efficient scheduling of tasks and modular design
 Good when problems can be broken down into subproblems

Disadvantages:-
 Controller can become extremely complex to make the best use of available
knowledge sources, which can lead to errors or delays if implemented
incorrectly.
 Difficult to breakdown problem into subcomponents to be worked on
 Most software engineering is modular and enclosed, Blackboard tries to
share everything
 Everything is shared and can introduce side effects

Example
The workplace is typically a hierarchy. The titles begin with CEO and then
descend down the executive ladder to the COO, then to a president, a vice
president, a manager, an assistant manager, and then individual employees.
Churches are often hierarchical systems.

7.Distributed Architectural Style:-


In distributed architecture, components are presented on different platforms and
several components can cooperate with one another over a communication network
in order to achieve a specific objective or goal.
Diagram:-

Advantages:-
 Sharing of hardware and software resources.
 Flexibility of using hardware and software of different vendors.
 Concurrent processing to enhance performance.
 Increased throughput by adding new resources.
 The ability to continue in operation after a fault has occurred.

Disadvantages:-
 They are more complex than centralized systems.
 More susceptible to external attack.
 More effort required for system management.
 Unpredictable responses depending on the system organization and network
load.

Example:-
Telephone and cellular networks are also examples of distributed networks.
Telephone networks have been around for over a century and it started as an early
example of a peer to peer network.
8. Broker Architectural Style
The broker pattern is an architectural pattern that can be used to structure
distributed software systems with decoupled components that interact by remote
procedure calls. A broker component is responsible for coordinating
communication, such as forwarding requests, as well as for transmitting results and
exceptions.

Diagram:-

Usage:-
Broker Architectural Style is a middleware architecture used in distributed
computing to coordinate and enable the communication between registered servers
and clients. Here, object communication takes place through a middleware system
called an object request broker (software bus).

Advantages:
 High throughput, low latency
 Easily integrated into components, lightweight deployment (no need to
deploy a broker).

Disadvantages:-
 Messages not guaranteed delivery. Some may be dropped. This may be a
problem in the orange highlighted areas. It's not critical for the GUI, but if
the local control module is making decisions, it might need all the
information. (Thinking about it, just the latest is probably good enough - no
point making a decision with out of date data). Similarly, if the network
between A and B goes down, the historian will have incomplete history.
How critical is this though?
 No "discovery". Relationship between components needs to be more
managed.

Example:-
A server provides services by registering and publishing their interfaces with the
broker and clients can request the services from the broker statically or
dynamically by look-up. CORBA (Common Object Request Broker
Architecture) is a good implementation example of the broker architecture.

You might also like