Reprinted: https: //www.cnblogs.com/vipstone/p/6537353.html
A lot of practice found spooler, in fact, 90% of the code is the same, of course, in the case of abandoned complex business logic, then how can it effectively saving them time, then I would say that, for the back-end system Reflections automatically generated.
Applicable scenario:
1, Table id number is incremented (based on the case now since most of the table number is growing);
2, not too complex business relationship, such as a field in a table, stores a json object back to balance users, need to show to the user friendly customization segment ui interface; also stored in the table, such as the foreign key multiple id, but for the convenience of users, the tag name can only have a way to show users, so these super glue logic business scene, can not be satisfied;
Special Instructions:
The first stage of any automation program is to assist development, rather than the development of alternative, because no one needs simple and stereotyped system.
Enter text:
The core of this thinking is the following Roadmap:
As long as all of the above solves the problem, solve the problem of automatically generated.
solution:
Generation systems must be configurable rows, instead of coding needed to configure, and he must have been based on a template, a different program generated code is different, such as nodejs is html and controller, asp.net page is plus extension classes.
Realization of ideas:
1. The configuration template, extraction cycle generating label;
2. The configuration database, connect to the database;
3. All the tables are listed in the database, the developer is selected from the corresponding table, configured to generate a target;
4. Configure query, display a list of columns and order, configure add / modify templates;
5. Alternatively cycle templates, generating a template;
This on the development is complete.