InProgramDuring the development process, programmers often do repetitive work. The most common is to access the database. programmers often write operations such as adding, deleting, modifying, and paging. In order to avoid this problem, it saves a lot of time for mechanical input and repetitive work, improves work efficiency, and focuses on the development of core business logic. A suitableCodeThe generator is very important.
1. Dynamic Software
The most popular in China. Dynamic software. net code generator is an automatic code generator developed by Li Tianping for C # Database programmers. The code generated by codematic is based on the object-oriented idea and three-tier architecture design, combining the classic ideas and design patterns in petshop, we integrate some ideas such as factory patterns and reflection mechanisms. This module automatically generates base-class code for tables in the corresponding database, including basic code snippets such as generating attributes, adding, modifying, deleting, querying, existence, and model class construction, supports code generation for three different architectures.
Other functions: automatically generate SQL scripts and automatically generate database structure documents.
Advantages: easy to use, in line with Chinese habits
Disadvantage: the flexibility is too low. After being generated, it often needs to be manually modified before it can be used in projects. Although some plug-ins are made publicSource codeBut it is still very troublesome.
: Http://www.maticsoft.com/download.aspx
2. codesmith
A template-based code generator with the highest international popularity. The template adopts a script language similar to C #, a bit like XLS + XML template generation method.
It is mainly characterized by the strong customization ability of templates. You can compile your own templates just like using C # language development programs. If it is too troublesome, you can find the desired template on the Internet and change it to your desired template with a slight modification. You have some ORM (nhibatis, ibatis, and LINQ), three-tier architecture (petshop, ntiers), Database (paging, crud stored procedures, basic data generation), and architecture (csla.. Net), Ajax, and so on. It covers almost all applications and can be said to be "unexpected, not impossible ".
The interface and operations are similar to visual stdio. After you select a template (double-click) in the template library, you can modify the template in the editing window (you do not need to modify the template unless otherwise specified). Then, in the attribute setting window,
- Advantages: flexibility; a large amount of template resources
- Disadvantages: learning related languages; charges
3. mygeneration. net
A very good code generation tool similar to codesmith is based on templates. It has the advantages of the majority of codesmith, and template resources do not need to be searched everywhere, the official website provides a large number of templates uploaded by the official or other users, as long as the client can be connected to the Internet, you can update these templates at any time, which is more convenient.
Another important point is that it is completely open-source. In this way, you do not need to pay a fee, and you can customize your own code generation tools.
: Http://sourceforge.net/projects/mygeneration