Velocity Template (left) and Generated Result (right)
Forms of Code Generation
Code Generator
Template independent
Domain Specific
Template based
Code Munger
Inline Code Expander
Mixed Code Generator
Partial Class Generator
Tier Generator
Example – Code Generator
CodeSmith
nHibernate Mapping Files Generation
Concerns and Constraints
Code generation is a design smell.
Engineers will ignore the 'do not edit' comments.
The generator won't be used or maintained.
My application isn't complex enough for generation.
My application is too complex for generation.
Reference
[1] Code Generation in Microsoft .NET . Kathleen Dollard. Apress.
[2] Generative Programming: Methods, Tools, and Applications . Krzysztof Czarnecki.
[3] Click and code [automatic code generation]. Maclay, D. IEE Review. Volume 46, Issue 3, May 2000.
[4] Graphical modelling and design with automatic code generation . Smith, M. Partitioning in Hardware-Software Codesigns, IEE Colloquium on.13 Feb 1995.
[5] Automatic code generation for actuator interfacing from a declarative specification . Jung, E.; Kapoor, C.; Batory, D. (IROS 2005). 2005 IEEE/RSJ International Conference on. 2-6 Aug. 2005
[6] Tools for the code generation . Johanna Ambrosio. Application Development Trends. 6/30/2003.
0 comments
Post a comment