Code Generation in Action
Overview Code Generation in Action, CGiA to its friends, is presented in two parts. The first part is four chapters, and covers a code generation case-study, the basic principles of code generation, including the different types of code generation strategies together with reasons why you would or would not use each strategy. The book's chosen toolset for building generators is presented next, and then some walk-through examples of building simple generators wraps up the first part.
The second part is a kind of a cross between a cookbook and a list of engineering solutions. There are nine chapters with the breadth of solutions covered being quite impressive, covering the gamut of generation of user interfaces, documentation, unit tests and data access code. Each chapter presents a couple of solutions within its topic area, often for different technologies within that topic. For example, the user interface chapter covers the generation of Java ServerPages, Swing dialog boxes and then Microsoft MFC dialog boxes. No favouritism here!
What's To Like There's a lot to like with this book. The writing is very clear and of good prose. I found the introduction to be very compelling, and I felt completely drawn in by the opening case-study. The four chapters of part one are a concise case for code generation, and would be very useful information to help persuade co-workers and management of the positive risk/benefit ratio with trying code-generation on a live project.It would be impossible to try enough of any solution from part two in a time-frame short enough to make this review useful, but in the solutions that match my areas of knowledge, I found myself admiring Herrington's straight-forward and pragmatic approach.
What's To Consider There are two aspects of this book that I want to flag. One of these aspects, some will love and others will hate, and that is the choice of generator language for CGiA. The author has chosen to use Ruby as his working language. This is an interesting choice. Ruby is certainly a language that is inspiring a lot of admiration these days (in fact, it's hard to get Dave Thomas to stop talking about it :-), but with the majority of the code-generation examples being for Java-related technologies, I wonder why Java was not selected instead.I also found myself wondering about the lack of discussion of how to integrate these Ruby tools into a typical Java build process. Many developers I know use ant to bring automation and consistency to their builds, yet the book doesn't mention this. (JRuby anyone?) Certainly something to consider for the second edition or future code-generation authors.
SummaryThis is a masterful tome that inspires and delights, although the two issues raised above did cost it a perfect score of ten.
Table Of Contents- Code generation fundamentals
- Overview
- Code generation basics
- Code generation tools
- Building simple generators
- Code generation solutions
- Generating user interfaces
- Generating documentation
- Generating unit tests
- Embedding SQL with generators
- Handling data
- Creating database access generators
- Generating web services layers
- Generating business logic
- More generator ideas
You can purchase Code Generation in Action from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Richard Hell and Codeoids
Code generation is definitely something programmers of large/complex projects should look into. There's a lot of different forms of it, and I'd be surprised if people haven't used one form or another already.
Ya, I've done some code generation myself. I used a text editor and my brain. How does everyone else do it?
I thought about using my wang instead of my brain but he just types screenfulls of the V word.
This book looks like a poor excuse for management drivel! If we could just get rid of those pesky programmers ... ah! Code Generation! Couple this with the move to push everything offshore ... and voila! no more pesky programmers. Now if we could just get them to finish the powerpoint compiler the development team was working on ....
PHB
coding's not hard. just create these dots and we'll connect them for you. just press a button.
They make the visual of some pale, skinny nerd with a "Got Root?" shirt on, banging away on a keyboard in a poorly lit dorm room sound exciting.
Too many buzzwords!
The sad thing is, I read that 100 as binary ;/
Yeah, honestly, these upstart newbies yaccing on about code generation as if it were some sort of new idea. Lex think for a minute and bison other books before we get carried away, shall we?
(And "active code generation" used to be called "high-level languages" and used fairly often by stronger programmers who didn't like cut-and-paste. Maybe that's not buzzwordy enough any more, though.)
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Ya, I've done some code generation myself. I used a text editor and my brain. How does everyone else do it?
I thought about using my wang instead of my brain but he just types screenfulls of the V word.
" V", huh? I feel sorry for your romantic partners. My wang can type " VFR"...
" VFR4" if I'm really excited.
SO YOU'RE GOING TO DIE: The Comic for Dealing with Death