Font Size: a A A

Template-based Automatic Code Generation Technology

Posted on:2008-11-23Degree:MasterType:Thesis
Country:ChinaCandidate:T Y GuanFull Text:PDF
GTID:2208360212499828Subject:Software engineering
Abstract/Summary:PDF Full Text Request
Code generation are about writing programs that write programs. In details, the process of code generation includes reading the text or model from the engineering, following specific rules, generating code that can be understood by computer.Nowadays, most programmers still handwrite their code. The traditional development pattern usually means low efficiency and long development cycles and also include a lot of repetitive work, which, on the contrary, lead to project delay, overspend, worse performance, even abortion. Programmers are forced to think about it and find new and effectively development pattern. Code generation come into being in this way.As a new software development pattern, code generation is still on its way to be mature, though code generation techniques has paid an important role in many project developments; still more need to be done for code generation techniques. In many aspects, code generation techniques make a better project and enhance efficiency in the development of software product.We analyze the state of the code generation techniques and existed solutions in this paper, introduce correlative techniques, such as template, metadata, reflection, XML, UML and so on. We raise a design model of code generation techniques. We implement this model by combining XML definition documents, template documents and template engine, plus correlative transform mechanism.According to the requirement, we construct the XML definitation files in diffierent way, and design the template files accordingly. The system core is the design and implementation of template engine, which includes the objectpool and contextobject. And then, the automatic generation module. Finally we use plugin technique to add the generated code into the specific system.In succession, we show the performance process and implement the code generation model in details via two test cases. According to the test result and speed analysis, we get the expected result, which prove the feasible of the solution. Finally, we point out the improving direction of this system.
Keywords/Search Tags:code generation, template, xml, template engine
PDF Full Text Request
Related items