Creating a standardized framework vs2017 Mvc project

 vs2107 + dapper + MiniUi make standardized layering and encapsulation

3.1 Creating a standardized framework vs2017 Mvc project

 

At this point the project to create the check to add unit tests.

 

Add a library, mainly for operating entity class, library name GG_Model.

 

 

 

 

Adding a library for the database operations. Library name: GG_DataAccess

 

 

 

Add library for the logging operation. Library name: GG_Log

 

 

Add library for the extended data. Library name: GG_Biz

Add library for the general procedure. Library name: GG_Common

Add mvc project for api interface. Name: GG_Api

 

Empty frame is created, as shown below:

 

 

Why build hierarchical?

1, to facilitate the division of the team:

A programmer to complete a software product alone is not impossible, but encountered a large software requires teamwork when the problem comes, because each programmer style is not the same, but a lot of code to develop software is not uniform style can cause post-commissioning and maintenance problems, but the software layered, each layer rational division of labor this problem will be solved.

2, the code specification:

Regulate, fixed style development language code of each layer in the development of software.

3, ignoring differences in the database:

Each layer of data for programmers only need to do the work of the same category, it can quickly convert the database, thereby improving work efficiency.

 

In to explain in the solution of this library is doing more than acting.

 

GG_Model library: database table when there are many fields of information, in order to be more convenient access to information in the database field, the need for the entity class table corresponding to the program, so that each of the object cases in accordance with the list information extracted in storage.

 

GG_Common library: designed to store some information common to the class, for example: MD5 encryption algorithm class, file upload, format conversion and more like

 

GG_Log library: log library operations.

 

GG_DataAccess library: implement database access layer. We need to manipulate the database (additions and deletions to change search). So we have a package base interface. For carrying out operations of the database. Then other objects of database access layer only needs to continue Chengzi Ji interface can operate the database.

 

GG_Biz library: This is our realization of the business logic layer, to achieve is to abstract database access layer implementation

 

GG_Api 接口:webapi项目,通过http模式(get,post,put)接收获取数据。

 

好的开始,是成功的一半。框架搭建也是,项目怎么样,打开项目看到分层建立感觉就会很不错,然后再是看代码。

 

可加qq群索要源码或交流:547765059

Guess you like

Origin www.cnblogs.com/seem111111/p/10944358.html
Recommended