OneCode low-code engine technology (4) back-end integrated development plan

foreword

In the past 2022, in terms of platform interconnection, Ali launched the open source engine "LowCodeEngin" in the second quarter, and the National Institute of Information and Communication Technology also launched the "General Technical Requirements for Low-Code Development Platforms" in the fourth quarter in response to market demand. For low-code related concepts and new function points, further specification and sorting out. In the first quarter of 2023, with the strong start of ChatGPT, the low-code and zero-code development with the purpose of "development for all" has been strongly pushed to the general public.

A brand-new "low-code era" is about to emerge, but all this is undoubtedly a torment for the traditional software industry that is on the cusp. For small and medium-sized industry software companies that have long been dominated by business customization and development, their weak technology accumulation has become the biggest barrier to independent research and development. Integration and open source secondary development have become the only choice for the traditional software industry to keep up with the times. Although there are some excellent open source frameworks in the open source field in the low-code field, such as Ali "LowCodeEngin" and Baidu "amis", most of them focus more on pure front-end However, these front-end technologies are difficult to learn and their lengthy tool chain makes their integration and embedding extremely complicated.

In this context, CodeBee launched an integrated development solution based on OneCode for software development teams. This article mainly explains the development and compilation principles of OneCode and the use of basic tools. In the following chapters, descriptions will be made based on specific examples, deployment management and other aspects.

1. OneCode technical principle and system composition

OneCode consists of three self-contained parts that can be deployed and run independently. The front-end engine is responsible for interface modeling and generates standard JSON according to the low-code protocol protocol. The middle and back-end OneCode completes the back-end view modeling by reading the standard JSON protocol, and merges the DSM back-end service modeling system to complete the complete back-end service modeling. Application, through code engineering to complete the coding application of front-end and back-end integration. JDSCloud is the collaborative support system of OneCode, which provides an independent sandbox operating environment in addition to the conventional resource code space management. Provide services such as engineering simulation version Ops for OneCode.

2. OneCode development mode

(1) CodeFrist mode (code first)

OneCode itself is based on the JAVA language system, which is a set of extended subsets based on Java Spring annotations. The hybrid compilation engine builds a complete Domain model through extended annotations, and completes the normal Web data delivery and scheduling process by reading standard Spring annotations. The Domain domain model dynamically renders the JS file output as JSON and delivers it to the front-end engine to build the page.

OneCode code compilation principle

General column display example

form example

In the open source organization plug-in, the complete OneCode development was used, and a typical example of embedded indicators was intercepted in the afternoon to explain.

real code example

To make it easier for everyone to get familiar with the basic syntax of OneCode, an online OneCode code editor is built into the OneCode platform components. Developers can directly edit and compile OneCode codes online conveniently.

OneCode web online IDE

To make it easier for you to get started quickly, OneCode also provides code template tools for various simple models, which is convenient for you to quickly build code structures when you get started.

In the code tool, in order to facilitate the access of different technology stacks, OneCode also opens up the management and construction functions of custom templates, which is convenient for everyone to design the code structure independently.

Business code template

After the coding is completed, the online compilation function of the cloud can be called to dynamically complete the code compilation. After the code compilation is completed, it can be downloaded to the local area for integration, or it can be deployed online for release and operation.

Compile online

(2), ViewFrist view priority (drag priority)

Use the view engine to drag and drop to complete the early interaction model, and then select the server-side code template to complete the basic code and modeling application.

Users can drag and drop

(3), ModuleFrist (model first)

In addition to implementing standardized component definitions on the front end, OneCode also provides an additional back-end modeling tool DSM, and connects the two through the domain model. In this way, when the front-end component is modeled, the back-end service model can be directly called to complete the API construction of the data part. The DSM model tool can also directly read the properties of front-end components during back-end modeling, and open up the communication capabilities between front-end actions and back-end services.

(4) DSM reverse conversion

DSM models completed in different ways can be freely switched between View, Code, and Module through OneCode, and use related tools to complete simulation debugging and deployment.

Traditional low-code platforms are basically built under the JS model. The structure is clear in the initial modeling, but after a little complicated logic, the redundancy and structure of the code will become chaotic during construction, especially When the page crosses the page or completes the front-end and back-end data interaction. Due to the characteristics of its scripting language, real-time verification cannot be completed, and problems can only be found during runtime testing. Pages built with low-code often cause unpredictable results just because of some simple additions and deletions of components or attribute styles in the page, which greatly reduces the maintainability of the code. The domain model built by OneCode solves this problem very well. When any model of the front-end and back-end changes, hybrid compilation can be called, and the connection relationship between pages and the data relationship between the front-end and the back-end can be verified and notified. Improve the overall compilation ability in precompilation.

(5) DSM third-party language conversion

The DSM code output module adopts an independent template architecture. In addition to existing in the form of OneCode, it can also support independent code output modules to customize independent third-party language model output.

Guess you like

Origin blog.csdn.net/wenzhangli/article/details/129731399