Combined with DDD design concept to achieve zero coding

In the actual development work, the domain model of the system is often designed to design the scalability and robustness of the system. At the same time, the basic management of data cannot be avoided, such as addition, deletion, modification and query, interface definition and implementation, etc. Some tasks are actually similar and repetitive, and have little to do with business logic. These tasks can often be automatically completed by the system, and the labor cost can be mainly concentrated on the design and implementation of the domain model.

 

The DDD design concept is generally divided into several layers, namely:

Presentation layer: mainly used for interaction with the outside world, including UI interface, open interface, etc.

Application layer: use case-oriented, orchestration of complex services, etc.

Domain layer: core business logic layer

Infrastructure layer: used for external interaction, such as database, message, search, etc.

 

As shown in the figure below, in theory, developers should focus on the design and development of the domain layer. They only need to implement the logic of the domain layer, and the codes of other layers should be automatically generated.

 

In order to achieve this small goal, we investigated the better framework in the industry, and the more widely used one is MybatisGenerator. Therefore, based on this framework, a zero-coding platform is realized.

 

The core architecture to achieve zero coding

 

After running, the core module is automatically generated, as shown in the figure below

 

Instructions for use

 1. Configuration items

1. Configure application.properties, mainly configure database connection information and project and package path information

 

Two, three operating modes

1. Run once to generate three core modules `client, dal, serviceImpl`, for details, refer to com.rhc.auto.App

2. According to your own needs, generate any code in any module of `client, dal, serviceImpl` separately, refer to `com.rhc.auto.App` for details

3. You can also generate the `repository` code you want on demand

    - For detailed usage, see: `com.rhc.auto.codegen.repository.RepositoryGenerator`

4. Interaction with the UI interface

    - By configuring the interaction fields between the front-end and the back-end, the web layer code is automatically generated, and the corresponding back-end code is automatically generated according to the interaction fields with the front-end,

    See `com.rhc.auto.codegen.web.SevenGroovyGenerator` for details

 

For more platform source code download addresses and usage methods, please use WeChat to scan the following QR code to view

 

 

 

 

 

 

 

Guess you like

Origin blog.csdn.net/qq_42672856/article/details/107592425