当前位置:网站首页>. Net core + DDD basic layering + project basic framework + personal summary "suggestions collection"
. Net core + DDD basic layering + project basic framework + personal summary "suggestions collection"
2022-06-29 07:01:00 【Java architects must see】
Why write this article
1, More than half a year ago , The company's development task is relatively easy , I don't know what to do , But want to learn technology , More confused , Later, I came into contact with the blog Garden , Read a post , that , I didn't know what to learn , So I gave him the information , He actually replied to me , And also give me suggestions on the direction of learning , And the method of learning , I am very grateful to him .
2, In an interview , Someone asked me. , Your work 1 Have you ever made a self summary for more than years , What do you think your strengths are , I answered haltingly , My heart is very flustered , Here is a summary .
3, Studied for a while .Net Core 了 , Poor memory , recorded , Prepare for future use .
The project foundation is layered
I'm learning DDD Hierarchical knowledge of , Now the code only uses some DDD Knowledge of tactical design , Now this stratification is enough for future knowledge accumulation , Perfect the above , The current technology is very good , Write the part you have used or can understand in combination with the understanding of the Internet and the use .
Infrastructure layer
Knowledge of the infrastructure layer :Code First ,EF Core,Autofac Dependency injection , Implementation interface of warehousing mode , Implementation interface of domain service , cache , And various basic tools
One ,Code First: Use Code First Data migration to database .
Common database migration commands : Add-Migration Migration name —— Add this migration Update-Database—— Migrate this time to the database Add-Migration InitialCreate -IgnoreChanges -—— Create an empty data migration : The current version is the starting point
Two ,EF Core : Soft delete —— Global filter deleted status ,AsNoTracking() —— Queries that are not persisted to the database use Any—— Query and judge using Any ,Z.EntityFramework.Plus-—— Bulk changes , Delete , Additions and deletions , Simple encapsulation asynchronous Anysnc Await Method
3、 ... and , Tool class , for example MD5,AutoMapperHelper,LamdaHelper,RedisHelper Simple application , Read configuration file , Unified return parameters, etc .
Four ,Redis cache , Multiple data types , Inquire about , High insertion efficiency ,Redis Synchronize policy with database , First update the database and delete the cache , Delay double delete ,( Time delay , Judge the delay time according to the data queried ), Use StackExchange.Redis
application layer
Relevant knowledge used by the application layer :AutoMapper,Dto,Autofac Dependency injection
One ,Dto: Data transmission object , Mainly the presentation layer and application layer transmit data
Two ,AutoMapper: Transfer data between objects , First, use the warehouse to query the data , And then through AutoMapper Convert to the data required by the front end and return
Domain layer
Knowledge used in the domain layer : Entity , The value object , Domain service interface , Warehouse interface , polymerization ,Autofac Dependency injection
One , Entity : There's a unique identification ( only , immutable ), Include business logic , And its own verification , Constructor instantiation , The entity's Set Should be set to private
Two , The value object : There is no unique identity , Used to describe the characteristics of a thing , What is the representation
3、 ... and , polymerization : Aggregate roots are entities , Aggregation is a combination of objects , The aggregation itself maintains its own consistency , Encapsulate business logic , Aggregate as small as possible , Aggregations are referenced by unique identifiers
Four , Storage : Warehousing is for aggregation , Encapsulate domain logic , Clarify the purpose of the query , Only the aggregated status is maintained in the warehouse , No persistence , Storage can facilitate unit testing , Replace ORM
5、 ... and , Field service :, Domain services are stateless , Some business logic that cannot be put into aggregation can use domain services , Multiple aggregation roots coordinate , Warehousing can be used in domain services
6、 ... and ,Autofac Dependency injection : It is conducive to decoupling between project layers , Facilitate unit testing , Constructor injection , Dependency inversion , Injection of assemblies by convention
Presentation layer
One , Show the relevant knowledge used by the layer :.Net Core WebApi ,MVC,JWT Swagger, Capture of log exceptions , Model validation ,Log4Net,Autofac Dependency injection , filter
Two ,JWT:JWT Includes the use of . Three separate parts : Header Head Payload load Signature Signature , Add... To each request on the front end JWT Issued by Token To replace Session, Verify the access page
3、 ... and ,Swagger: have access to Swagger To request WebApi , And view WebApi Interface ,Swagger Interface documents can be made
Four ,Log4Net: Global capture of log exceptions , Log to TXT in
5、 ... and , filter : Use filters to validate the model ,Log4Net Global capture of log exceptions , And access to permissions
Simple unit testing
Relevant knowledge used in unit testing :Xunit,Autofac Dependency injection
The direction of study , And the goal
Thank you for your guidance , Study .Net Core Broadened my horizons , Only to learn that DDD,ABP, And the above technology , Although my skills are still very good , Many technologies and basic knowledge are not very solid , But I will continue to study , Thanks to every technology sharer in the blog Park .
One , Direction : Study Redis , Message queue , Read / write separation ,DDD , Business analysis capabilities , ABP
Two , The goal is : Next year, I will become an intermediate programmer
Project source address
边栏推荐
- Teach you how to develop your own NPM package (publish to the NPM official website)
- It is the only one in China that Alibaba cloud container service has entered the Forrester leader quadrant
- 力扣每日一题-第30天-1281.整数的各位积和之差
- 存token获取token刷新token发送header头
- Testing grpc service with grpcui
- QT qframe details
- C language pointer to function
- CI工具Jenkins之二:搭建一个简单的CI项目
- Yyds dry goods inventory meituan's two-sided experience, and finally there was a surprise?
- List collection implements paging
猜你喜欢

JDBC连接数据库,socket发送客户端。

层次分析法

idea使用

转:侯宏:企业数字化转型的关键不是技术,而是战略

Illustrate plug-in -- AI plug-in development -- creative plug-in -- astute graphics -- path width style function

CI工具Jenkins之二:搭建一个简单的CI项目

Redistemplate handles hash integer type problem resolution

The annual technology inventory of cloud primitives was released, and it was the right time to ride the wind and waves

jetson tx2

Introduction to Ceres Quartet
随机推荐
Qt 自定义位操作类
Service grid ASM year end summary: how do end users use the service grid?
百度小程序自动提交搜索
Li Kou daily question - day 30 -1523 Number of bit 1
存token获取token刷新token发送header头
Qt 程序打包发布-windeployqt工具
Where is the Gcov symbol- Where are the gcov symbols?
About DDNS
Ribbon service invocation and load balancing
数据库-同义词
Aging design guide for applets
How to do the performance pressure test of "Health Code"
[c language] [sword finger offer article] - print linked list from end to end
JDBC | Chapter 5: closing and releasing JDBC connection resources
更改主机名的方法(永久)
NoSQL数据库之Redis(五):Redis_Jedis_测试
JDBC connects to the database and socket sends the client.
C language pointer to function
关于 localStorage 的一些高阶用法
QT container class