Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / programming / architecture

Layered Application Architecture with a Homogeneous Layer Structure

5.00/5 (1 vote)
15 Nov 2021CPOL6 min read 5.6K  
The architecture of a multilayer application with homogeneous layer structure is described.
This article describes the architecture of a multilayer application with a homogeneous layer structure. The interaction of the application with its environment (application boundaries, external consumer, external data sources) is considered. Provides examples of the content of the application layers and sublayers.

Introduction

This article is a development of the article. ”Examples of Layered Application Architecture Based on the Use of Sublayers Sets and a Hierarchy of Data Models”.

Application Interfaces

In general, an application can interact with the external consumer set and the external data source set. The external consumer performs the functions of the data consumer and / or data producer. An external data source performs the functions of the data consumer and / or data producer.

To build a multilayer architecture, it is necessary to define application boundaries.

The application upper boundary delimits the functional area of the application and the area of external consumers. The application lower boundary delimits the area of the application functionality and the area of external data sources.

Using the concept of application boundaries, you can define the application interfaces.

The application input interface is at the application upper boundary. The application input interface is the gateway for the interaction of the application functionality with external consumers. Examples of application input interface are visual interface (consists of a set of visual forms) and data transfer interface (consists of a set of server-side endpoints).

If the application does not interact with external consumers, the application input interface is the internal interface, which consists of a set of timers and / or an internal application schedule.

The application input interface interacts with the application functionality when events from external consumers occur.

External data sources can be divided into tw. types - local data sources and remote data sources.
The application interacts with local data sources directly without using drivers and software libraries. Examples of local data sources are local files and shared files in the local network, USB / COM / LPT ports.

The application output interface is at the application lower boundary. The application output interface is the gateway for the interaction of the application functionality with remote data sources. The elements of the application output interface are client-side sockets, proxy objects for interaction with web services, database drivers and external device drivers. Examples of remote data sources are server and desktop databases, FTP servers, directory services (LDAP, Active Directory), email and document storage systems.

Image 1

Figure 1. Structure of the application and its environment - application boundaries, external consumer o. external data sources.

Homogeneous Structure of Application Layers

A multilayer application architecture can be represented as a set of layers with a homogeneous structure. Each layer consists of a set of sublayers. A multitier application consists of a set of multilayer applications that interact with each other. Any application can be represented as 1-tier or multi-tier application in which each tier is a multilayer application.

The multilayer architecture is based on the homogeneous structure of each layer and the hierarchical interaction between the layers.

Application layer consists of layer functionality and layer data. Layer functionality consists of operations and events. Layer data is organized as a set of data models.

Application layer homogeneity means that the structure of any layer is the same set of sublayers with the same scheme of interaction between the sublayers.

Hierarchy of interaction between layers:

  1. interaction between adjacent layers and between sublayers of the same layer is unidirectional
  2. data exchange between data models of the layers is bidirectional

The sublayer consists of the sublayer API, which is accessible from the upper layer or sublayer, and the internal sublayer functionality. The sublayer API consists of a set of sublayer operations.

Image 2

Figure 2. Sublayer structure

Image 3

Figure 3. Interaction scheme between sublayers of the same layer

A complete 1-tier application structure scheme, taking into account the set of layers, application boundaries and application interfaces, is shown in Figure 4.

Image 4

Figure 4. Layer structure and interaction scheme between the layers of a multilayer application.

Facade sublayer of any application layer provides access to layer functionality from upper layer.

Facade sublayer of facade layer is a set of visual form event handlers or a set of front controllers.

Facade sublayer of logic layer implements the application logic, which coordinates the execution of business logic operations and the processing of external data.

Facade sublayer of persistence layer is a set of external data access objects.

Logic sublayer of any application layer implements the internal logic of that layer. Logic sublayer of logic layer implements the business logic (domain logic) of the application.

The data access sublayer of any application layer implements access to external data. For the persistence layer, accessing and processing external data is the main task. For the façade layer and logic layer, there are three ways to access external data sources:

  1. Direct access to local data sources (local files and shared files in the local network)
  2. Access via application output interface (access to directory services, email and document storage systems)
  3. Access via persistence layer (access to relational databases)

Description of the Structure and Content of the Application Layers and Sublayers

The table shows examples of the content of the application layers and sublayers.

Sublayer Namespaces / packages Comments
     
  Application input interface  
  visual interface set of visual forms
  data transfer interface set of server-side endpoints
  internal interface internal application schedule, set of timers
     
  Façade layer  
Façade sublayer [FacadeRoot].Facade.Forms set of visual interface event handlers (for applications with visual interface)
  [FacadeRoot].Facade.Controllers set of front controllers (for web-services, ASP.NET MVC applications)
  [FacadeRoot].Facade.Timers set of timer tick event handlers
     
Logic sublayer [FacadeRoot].Logic.Internal.Services.PresentationLogicServices presentation logic for applications with visual interface
  [FacadeRoot].Logic.Internal.Services.InteractionLogicServices inner logic for web-services
     
Data access sublayer [FacadeRoot].Logic.External.Services.PersistenceServices command / query operations
  [FacadeRoot].Logic.External.Services.NotificationServices notification operations
  [FacadeRoot].Logic.External.Services.DataTransferServices data transfer operations
     
  Logic layer  
Façade sublayer [LogicRoot].Facade.Handlers application logic
  [LogicRoot].Facade.UnitOfWorks  
     
Logic sublayer [LogicRoot].Logic.Internal.Services.DomainServices domain logic
     
Data access sublayer [LogicRoot].Logic.External.Services.PersistenceServices command / query operations
  [LogicRoot].Logic.External.Services.NotificationServices notification operations
  [LogicRoot].Logic.External.Services.DataTransferServices data transfer operations
     
  Persistence layer  
Façade sublayer [PersistenceRoot].Facade.DataAccessObjects external data access objects
     
Logic sublayer [PersistenceRoot].Logic.Internal.Services.InternalLogicServices  
     
Data access sublayer [PersistenceRoot].Logic.External.Data.PersistenceManagers when using direct SQL queries
  [PersistenceRoot].Logic.External.Data.DatabaseContexts when using ORM-framework
  [PersistenceRoot].Logic.External.Data.EntityManagers when using ORM-framework
  [PersistenceRoot].Logic.External.Connections.DatabaseConnections  

History

  • 15th November, 2021: Initial version

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)