当前位置:网站首页>ABP framework

ABP framework

2022-06-26 03:44:00 yuyue5945

ABP Framework Basics

ABP Is an open source and document friendly application framework .ABP It's not just a framework , It also provides a practical Domain Driven Design (DDD) The architecture model of , Can support .net framework and .net core Two technical schools .

ABP Frame features

  • Dependency injection , This part uses Castle windsor ( Dependency injection container ) To implement dependency injection , This is also what we often use IOC To deal with the way ;
  • Repository Storage mode , Has been realized. Entity Framework、NHibernate、MangoDB、 Memory database, etc , The storage mode can realize the call of data interface quickly ;
  • Authentication and authorization management , You can use the declaration feature to log in to the user or not , Or verify the permission of the interface , In a very fine-grained way , Set the call permission of each interface ;
  • Data validation ,ABP Automatically judge the input parameter object of the interface , And the validity of the attribute can be verified according to the application information of the attribute ;
  • Audit logs , That is to record our call records for each interface , And the creation of records 、 modify 、 Delete personnel for records and other processing ;
  • Unit Of Work Work unit mode , Automatically implement database transactions for application layer and storage layer methods , Default interface of all application service layers , They all work in units of work , Even if they call different storage objects to handle , They are all in the logic of a transaction ;
  • exception handling ,ABP The framework provides a complete set of process processing operations , It is very convenient to record and pass exceptions ;
  • logging , We can use Log4Net Do regular logging , It's convenient for us to track the program processing information and error information ;
  • Multilingual / Localization support ,ABP The framework is also friendly to multi language processing , Provide for the right to XML、JSON Language information configuration processing ;
  • Auto Mapping Automatic mapping , This is ABP An important concept of object isolation , By using AutoMaper To implement domain objects and DTO Property mapping of objects , Can isolate the logical relationship between the two , But it can easily realize the assignment of attribute information ;
  • dynamic Web API layer , Take advantage of this dynamic processing , You can put Application Service Direct release as Web API layer , There is no need to manually create one for each business object Web API The controller , Very convenient ;
  • dynamic JavaScript Of AJax Agent processing , Can automatically create Javascript The agent layer is more convenient to use Web Api, This is in Web Layer using .

ABP Special features of the framework

  • Multi tenant support ( Each tenant's data is automatically isolated , Business module developers do not need to write code when saving and querying data ;
  • Soft delete support ( Inherit the corresponding base class or implement the corresponding interface , Soft deletion will be realized automatically )
  • System settings access management ( The system level 、 Tenant level 、 User level , Scope of action automatic management )
  • EventBus Implement domain events (Domain Events)
  • Modules and module dependencies to achieve plug-in module processing and so on

ABP Framework hierarchical architecture diagram

ABPLayer

The idea of separation between the front and the back , Not only can it be applied to Web Of B/S Development , Apply to both C/S Development

  • front end Web The end can use Ant-Design(React)、IView(VUE)、Angular And so on different front-end technology to carry the interface presentation layer
  • front end Client The desktop side can use MaterialDesign design code , according to Prism perhaps MVMMLight Of MVMVM Framework combined with application

WEB API Priority Architecture

ABP The core of the framework is mainly .NET The back-end technology stack is the main line , although ASP.NET CORE MVC and Web API It's divided into two parts , But his dynamic release is Web API Limited architecture provides better convenience .

In today's popular presentation layer , More and more independent of the back-end technology implementation , And focus on Web API Standardized docking , be based on JSON Interactive processing of data . No matter what it is Ant-Design(React)、IView(VUE)、Angular And so on Web front end , We can see that these architectures are easy to implement Web API Standard interface docking , In my earlier offer of Winform Inside the hybrid frame , Also with Web API Priority strategy for Cloud Application Deployment

ABP The project structure of the framework

ABP The framework consists of two parts , A basic ABP frame , One ABP Extended applications based on the basic framework . It provides personnel 、 role 、 jurisdiction 、 conversation 、 Authentication 、 multi-tenancy 、 Logging and so on , We generally mean ABP Framework application is to expand its business project on this basis . This part , We can configure certain options according to the official website , Then download and use .

Infrastructure components

PackageStatus
Abp NuGetversion
Abp.AspNetCoreNuGet version
Abp.Web.CommonNuGet version
Abp.Web NuGetversion
Abp.Web.Mvc NuGetversion
Abp.Web.Api NuGetversion
Abp.Web.Api.ODataNuGet version
Abp.Web.ResourcesNuGet version
Abp.Web.SignalRNuGet version
Abp.OwinNuGet version
Abp.EntityFramework.CommonNuGet version
Abp.EntityFrameworkNuGet version
Abp.EntityFramework.GraphDiffNuGet version
Abp.EntityFrameworkCoreNuGet version
Abp.NHibernateNuGet version
Abp.DapperNuGet version
Abp.FluentMigratorNuGet version
Abp.AspNetCoreNuGet version
Abp.AspNetCore.SignalRNuGet version
Abp.AutoMapperNuGet version
Abp.HangFireNuGet version
Abp.HangFire.AspNetCoreNuGet version
Abp.Castle.Log4NetNuGet version
Abp.RedisCacheNuGet version
Abp.RedisCache.ProtoBufNuGet version
Abp.MailKitNuGet version
Abp.QuartzNuGet version
Abp.TestBaseNuGet version
Abp.AspNetCore.TestBaseNuGet version

The template style of extension application is as follows , You need to download it from the official website

ABP Template address

download .net core After the project , The project view of the back-end part is as follows

ABP Extension template address

We can see from this project , It is mainly divided into the following several project layers .

  • Application application layer : The application layer provides some application services (Application Services) Method is called by the presentation layer . An application service method receives a DTO( Data transmission object ) As input parameter , Use this input parameter to perform specific domain level operations , And return to another... As needed DTO.

  • Core Domain core layer , The domain layer is the business layer , Is the core of a project , All business rules should be implemented at the domain level . In this project , In addition to defining the required domain entity classes , In fact, we can define our own custom warehousing objects ( similar DAL/IDAL), And define your own business logic layer ( similar BLL/IBLL), And based on AutoMapper Mapping rules and so on .

  • EntityFrameworkCore The core layer of Entity Framework , This project doesn't need to change much , Only need DbContext The storage object of the corresponding domain object can be added .

  • Migrator Data migration layer , This is a console program project created by assistant , If based on DB First, We can use it to create our project's initialization database .

  • Web.Core Web Core layer , be based on Web perhaps Web API The core layer of , Provides the basic processing of authentication login , Nothing else .

  • Web.Core.Host Web API The host layer of , It's also a dynamic release Web API The core content , In addition to Web API It's integrated Swagger, Make it convenient for us to Web API Debug the interface of .

  • Tests Unit test layer , This provides some simulation tests of application layer objects , The database tested uses Entity Framework Memory database of , Does not affect the actual database content .

eb API Debug the interface of .

  • Tests Unit test layer , This provides some simulation tests of application layer objects , The database tested uses Entity Framework Memory database of , Does not affect the actual database content .
原网站

版权声明
本文为[yuyue5945]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202180546225275.html