ABP Development Notes 2 - Architecture

Click here to enter the ABP Development Notes directory

 

ABP layered architecture

Introduction

Layered application code base is a widely accepted technology that helps reduce complexity and improve code reusability. In order to achieve a layered architecture, ASP.NET Boilerplate follow domain-driven design principles .

Domain driven design layer

Domain Driven Design (DDD) has four basic layers:

  • Presentation layer : to provide users interface. Use the application layer user interaction.
  • Application Layer : intermediating between the presentation layer and the layer domain. Orchestrating business objects to perform specific application tasks.
  • Domain Layer : includes business objects and rules. This is the core of the application.
  • Infrastructure Layer : provide a common technical features that primarily use third-party libraries to support higher layer.

ASP.NET model application architecture model

DDD addition, the application of modern architecture also includes other logical and physical layer. Recommend and implement the following model ASP.NET Boilerplate application. ASP.NET Boilerplate not only by providing base classes and services that enable easier implementation of this model, but also provides a model directly from the start of the start template .

ASP.NET Boilerplate NLayer architecture

Client application
which is a remote client, they will use the application as service via HTTP API (API controller, OData controller, even GraphQL endpoint). The remote client can be a SPA (single-page application), mobile application or third-party user. Localization and navigation can be done in this application.

Presentation layer
ASP.NET Core MVC (Model - View - Controller) can be regarded as the presentation layer. It may be a physical layer (application by using the HTTP API) or a logical layer (using direct injection and application services). In either case, it may include localization, navigation, object mapping, caching, configuration management, audit logs. It also handles authorization, session, function (for multi-tenant applications) and exception handling.

Distributed Services layer is
the layer for providing an application / domain function by REST, OData, GraphQL like the API remote ... They do not contain the business logic, and only the HTTP request into an interaction domain, or may use service applications to Principal operations. The layer typically comprises authorization cache, audit logging, object mapping, exception handling, and the sessions.

Application Layer
The application layer includes the use of application services layer art and art objects (field service entity ...) to perform the functions of the application request. It uses the acquired transmission-object data and returns the data to the data representing the distributed services layer or layers from the presentation layer or distributed services layer. It also handles authorization, caching, audit logging, mapping objects, and other sessions.

Domain Layer
This layer is the main achievement of our domain logic. It includes physical, service areas and the value of the object to perform the service / Domain logic. It also includes a specification of the field and trigger events. It defines an interface to read and store data from the reserved source (usually DBMS) entity.

Infrastructure layer
infrastructure layer the other layers play: it implements an interface repository (for example, using Entity Framework Core) to the actual use of the actual database. It may also include integration with suppliers to send e-mail. This is not strictly layer in all layers, but in fact to support the other layers by implementing abstraction layer.

Guess you like

Origin www.cnblogs.com/IT-Evan/p/ABP2.html