Software Reality
Programming with
a dose of satire.

Site Map Search


Agile Development
 
Extreme Programming
 
Code Generation


Articles
Lifecycle
Design
Programming
Soapbox
Reviews
Cthulhu

Java Swing
Swing's greatest threat isn't SWT, it's Flash
Swing Survival Guide


 
Check out our ageing Reviews Section


Use Case Driven
Use Case Driven Object Modeling with UML: Theory and Practice
Get from use cases to working, maintainable source code. Examples use Spring Framework, JUnit and Enterprise Architect

Agile UML
Agile Development with ICONIX Process
A practical subset of agile development techniques, illustrated by example

Get Controversial!
Extreme Programming Refactored
Extreme Programming with a dose of satire
Available now:



Programming

Automated Code Generation (Page 2)

<< Page 1 (Introduction & Message Forum)


What Is a Code Generator?

A code generator reads your project meta-data (for example a database model) and churns out well-formed source code to a specific set of design patterns.

Think of a generator as being a bonus member of your project team - one who embodies the experience of many developers, produces ultra-consistent code in minutes instead of months, and should (in theory, at least) have a much, much lower bug rate than the rest of the team.

It should be stressed, however, that code generation - whilst incredibly useful - is no silver bullet. It won't magically guarantee success for your project. You still need quality staff to evaluate, to design, and to code all the areas not covered by the generator. What a generator can give you though, is a massive head start in any new project.

Code generators can also make your project very agile. A change in implementation is simply a different rendering of the same meta-data. When coming to a fork in the road, hand coders will pick one road or another. With a generator you can follow both roads, and simply have a switch in your meta-data to choose which you'd like to try.

Anything which is repetitive can be automated. This is an approach which is already gathering speed in the agile community, for example with automated unit tests and functional tests. Nowadays it is rare to see a project that doesn't use an automated build script (e.g. using the Ant build tool). Automation is key to agility.

Similarly, given the correct conditions, a lot of source code can be automatically generated - the programmer is then free to "fill in the gaps". The gain in development speed via code generation (under the right conditions) cannot be emphasised enough: we are talking orders of magnitude in increased productivity.

Code generators are distinct creatures from the "wizards" seen in IDEs such as NetBeans and Eclipse. Wizards are great time-savers for quickly generating one or two classes, but that does tend to be as far as they go. The difference is that code generators churn out entire APIs, sometimes even entire applications.

Currently, there is a proliferation of code generators on the market - some free, open source or shareware, others commercial products aimed at high-end applications and "blue chip" clients. More seem to be appearing all the time. The diversity of the generators' approaches and varying technologies (of both the code being generated and the tool used to do the donkey work) are indicative of a burgeoning software market, awash with fresh ideas - but noticeably lacking in formal standards at this stage.


>> Page 3 (How do Code Generators Work?)

<< Back to Programming

All trademarks and copyrights on this page are owned by their respective owners.
Stories and articles are owned by the original author.
All the rest Copyright © 1998-2008 Matt Stephens. ALL RIGHTS RESERVED.