A Spring Cloud-based code generation method

A code generation and code file technology, applied in the field of microservices, can solve problems such as more time-consuming, increased code files and code volume, and increased development complexity, so as to quickly respond to changes in requirements, reduce error rates, and speed up development efficiency Effect

Inactive Publication Date: 2019-05-03
G CLOUD TECH
View PDF4 Cites 8 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

"Single responsibility" is one of the basic principles of microservices, which requires the microservice framework to be divided into modules, and each microservice only complete

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A Spring Cloud-based code generation method
  • A Spring Cloud-based code generation method

Examples

Experimental program
Comparison scheme
Effect test

Example Embodiment

[0034] See figure 1 As shown, it is a flow chart of the code generation method based on Spring Cloud of the present invention; the basic process of adopting this method is as follows:

[0035] S10: Create a code generation template for Spring Cloud's remote invocation interface.

[0036] The remote invocation interface is used to define the remote invocation method name, parameters, return value and request type.

[0037] The specific content of the remote invocation interface code generation template is: generating a database table according to needs, and obtaining the detailed attributes and table structure information of the database table for generating code. Set the interface package name and the class to be imported according to the obtained database table information, specify the name of the microservice to be called and set the circuit breaker class through annotations on the interface, and then generate common interface methods, including adding, adding in batches, m...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to the technical field of microservices, in particular to a Spring Cloud-based code generation method. The method comprises the following steps: firstly, creating a Spring Cloudremote calling interface code generation template, a remote calling implementation class code generation template, fusing class code generation template, and then realizing a Spring Cloudd-based codegeneration method; and finally, setting a code generation parameter to generate a code file, and adding the code file into the project. Code compiling in micro-service development can be reduced, thedevelopment efficiency is improved, and quick response and demand change are achieved according to needs; and the method can be used for micro-service development.

Description

technical field [0001] The invention relates to the technical field of microservices, in particular to a code generation method based on Spring Cloud. Background technique [0002] The microservice framework is a method of developing a single application as a set of small services. It splits a large single application and service into several or even dozens of supporting microservices, and each service is developed for an independent business. , a microservice generally completes a specific function. Microservices have the advantages of loose coupling, high fault tolerance, and on-demand expansion. [0003] The current microservice framework has various advantages, but there are also shortcomings. "Single responsibility" is one of the basic principles of microservices, which requires the microservice framework to be divided into modules, and each microservice only completes the functions of its own modules; this will increase the complexity of development, increase the num...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F8/33G06F8/20
Inventor 张伟荣季统凯
Owner G CLOUD TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products