Software Architecture patterns

Architectural patterns help specify the fundamental characteristics and behavior of a software.
It refers to the fundamental structures of a software system and the discipline of creating such structures and systems. This means Software Architecture serves as a blueprint or template for a system. It offers an abstraction to handle the system complexity, and establishes a communication and coordination mechanism among software components and elements. Software Architecture is about building essential structural choices, which are costly to change once implemented.

Layered pattern

A layered architecture is classified into four distinct layers: But there is no rule to use/keep all these layers. According to the purpose or type of the application we can use any number of layers.
  • Presentation - Graphical design of the software, as well as any code to manage user interaction
  • Business - Manages all business logic, validations, and business processes.
  • Persistence - Responsible for interacting with a database, which also known as the persistence layer.
  • Database -This layer is the real data store for the software. It consists of the code to access and handle the database behind the software product, as well as the underlying database technology.


Easy to develop, test, and maintain software in practice as it has break into limited scopes which is easy to create effective roles and responsibilities.

Layers of isolation.means that changes made in one layer of the architecture do not make effect on components in other layers

Could not be productive in a constantly changing environment because it is not possible to respond changes immediatelyomponents in other layers

Used in general desktop applications,Tieght dead line and budget


Client server pattern

Client -which is the service requester.

Server - which is the service provider. 

Although both client and server may be located within the same system, they often communicate over a network on separate hardware. These components are linked by request/reply connectors. A classic example of this architecture pattern is the World Wide Web. The client-server pattern is also used for online applications such as file sharing and email.

Advantage 

The central computing of data - all files are stored in a central location for this network. Therefore, the data, as well as the network peripherals, are centrally controlled. 

Disadvantage

  • The server is expensive to purchase and manage.
  • Server is a bottle neck


Model viewer controller pattern

Model - Central component of the pattern, contains the application data and core functionality. It is the dynamic data structure of the software application, and it controls the data and logic of the application. However, it does not contain the logic that describes how the data is presented to a user.

View -  displays application data and interacts with the user. It can access data in the model but cannot understand the data, nor does it understand how the data can be manipulated.

Controller -  handles the input from the user and mediates between the model and the view. It listens to external inputs from the view or from a user and creates appropriate outputs. The controller interacts with the model by calling a method on it to generate appropriate responses.


Advantages

  • Development of the application becomes fast.
  • Easy for multiple developers to collaborate and work together.
  • Easier to Update the application.
  • Easier to Debug as we have multiple levels properly written in the application.

Disadvantages 

  • It is hard to understand the MVC architecture.
  • Must have strict rules on methods.


Microservices architechture

Microservices pattern involves creating multiple application or microservices that can work interdependently. Each microservice can be developed and deployed independently, its functionality is interwoven with other microservices. This creates a streamlined delivery pipeline which allows for easy deployment of microservices and increases application scalability. This pattern is a distributed architecture, meaning that the structure's components can be fully decoupled and accessed through remote access protocols such as REST, SOAP, or GraphQL



Advantage

  • Independent deployment of each microservice.
  • write and maintain each microservice independent of the others, potentially increasing its functionality and scalability. 
  • Easier to rewrite and update as microservices are small. 
  • Microservices architecture is best for web applications and websites with small components. 
  • It is also useful for corporate data centers that have well-defined boundaries. 

Challenges for microservices

  • Complexity, particularly in the network layer.
  • Decoupling services to work completely independent of each other requires significant architectural expertise.


Pipe-filter pattern



Pipe and Filter has independent entities called filters (components) which perform transformations on data and process the input they receive, and pipes, which serve as connectors for the stream of data being transformed, each connected to the next component in the pipeline.
A single filter can consume data from, or produce data to, one or more ports. They can also run concurrently and are not dependent. The output of one filter is the input of another, hence, the order is very important.

Advantages
  • Ensures loose and flexible coupling of components, filters.
  •  Loose coupling allows filters to be changed without modifications to other filters.
  • Conductive to parallel processing.
Disadvantages
  • Addition of a large number of independent filters may reduce performance due to excessive computational overheads.
  • Not a good choice for an interactive system.
  • Pipe-and-fitter systems may not be appropriate for long-running computations.
Usages : Compilers - A compiler performs language transformation: Input is in language A and output is in language B. In order to do that the input goes through various stages inside the compiler.


And some other software architecture paterns are ;

Even bus pattern

  • easy to connect new connection

Brocker pattern

Peer to peer pattern

  • Support decentralized computing
  • Defficult to ensure security

Blackboard pattern

Contains : Blackboard , controller, knowledge source

Hard to modify the structure

Master slave pattern


Comments