DEV Community

Pranati
Pranati

Posted on • Edited on

Web Architecture Pattern:- Layered Pattern

Welcome! In this series we will look at different Architecture Patterns one by one.

Architecture patterns are well known patterns for solving software application architecture problems.

They are high-level strategies that concerns large-scale components, the global properties and mechanisms of a system.

A large complex software goes through a series of deconstruction at different levels.
At large level, architectural patterns are the tools. At smaller level, design patterns are the tools and at implementation level, programming paradigms are the tools.

The first Architecture Pattern:

  1. Layered Pattern

    • The most common architecture pattern is the layered 
      architecture pattern, otherwise known as the n-tier 
      architecture pattern
    
    • Components within the layered architecture pattern are 
      organized into horizontal layers, each layer performing 
      a specific role within the application 
    
    • The layered architecture pattern does not specify the 
      number and types of layers that must exist in the 
      pattern.
    

Most layered architectures consist of four standard layers: presentation, business, persistence, and database 

The layers of isolation concept also means that each layer is independent of the other layers, thereby having little or no knowledge of the inner workings of other layers in the architecture.

Alt Text

1.1 Different Layers :

The presentation layer:  Contains all of the classes responsible for presenting the UI to the end-user or sending the response back to the client 

The Business layer: Represents the underlying domain, mostly consisting of domain entities and, in some cases, services. Business rules, like invariants and algorithms, should all stay in this layer.

The Persistence Layer and Database Layer : Contains all the classes responsible for doing the technical stuff, like persisting the data in the database, like DAOs, repositories.

Usage

• General desktop applications.
• E commerce web applications.

Layered Architecture is about organizing code for a good separation of concerns and nothing else

Resources

https://dzone.com/articles/layered-architecture-is-good
https://www.oreilly.com/library/view/software-architecture-patterns/9781491971437/ch01.html
https://stackoverflow.com/questions/4243187/whats-the-difference-between-design-patterns-and-architectural-patterns

Top comments (0)