Introduction

One essential part of software architecting is deciding on the best strategy to layer your applications codebase. This is crucial as a good layering strategy will aid in reducing complexity and improving code reusability.

Client Applications

In this layer you typically have your remote clients accessing the logic of the application (usually exposed as REST endpoints). Clients in this layer are usually single page applications, mobile applications and basically any other third party application.

Presentation Layer

This is usually an internal web application and in the .NET world this would be the MVC web application. This layer interacts with the application service either through the service layer.

Application Layer

This layer contains the application services which would usually interact directly with domain objects and services to perform the use cases specific to the application. This layer also utilises command and query DTO objects as part of the CQRS pattern.

Domain Layer

Also sometimes referred to as core, this layer holds the domain objects and services. In addition it can also include interfaces, domain events and specifications.

Infrastructure Layer

The infrastructure layer deals with external systems. From hosting, email and third party API services through to database, logging and cache management.