Nowadays, there are now a system using the code generator because this application is data-centered, and the program is just a shell outside the database. The implementation function is in fact, and the difficulty is that there may be many kinds of data, and the relationship may be complicated. However, a group of modes have emerged through the development of these years. A pattern is a skeleton, and we only need to add some meat inside, and there will be many repetitive work in this. Because different types of data actually the access process is substantially the same.
First, a physical class is generated according to the content of the table.
I always feel that the parameter to the stored procedure is a trouble, so use classes to put the solid wind, and another class is specifically used to perform the stored procedure, I just pass the name of the entity class and store procedure to it, this class The entity class is as an Object Accept, we write the parameter information of the stored procedure in the configuration file in advance, then this class can obtain parameters from the physical classes based on the parameter information in the configuration file. And execute. And those configuration files can also be generated using code generators.