Rating:  Summary: Why write when you can generate? Review: If you are already a code generation fanatic, this book is a great way to understand the breadth of code generation techniques and will help you fine tune your techniques. Many code generators are developed in house by people who are very smart but who haven't had many other code generation systems to learn from.If you aren't a hardcore code generator, but your exposure is limited to casual use of XDoclet or code generation from UML tools, will you find value in the book? I think so. I am a huge fan of code generation tools, particularly XDoclet. If you have used XDoclet for any amount of time, chances are you are amazed at what code generation can do. Well, guess what? XDoclet is just the tip of the iceberg. If you want to take code generation to the next level, read this book. Finally, there are the non-generators. I have to say that if you aren't already a code generator, you might be overwhelmed by the scope of the book. Fortunately there are some good concept sections which explain the benefits of code generation and can get you started on the path to code generation enlightenment. I personally would recommend testing the waters with code generation tools like XDoclet before jumping into the techniques presented in the book. But if you are a senior programmer with a sense of adventure, then you'll have no problems getting started with this book. At 300 pages, the book is easily digestable. A lot of the examples are in ruby, but implementation language isn't an issue. This is a concept book, not a language book, and the ideas inside aren't limited to any one language or platform. (hint: you don't necessarily have to write a code generator in the same language you are generating for) This book definitely deserves a look if you are interested in code generation.
Rating:  Summary: Finally, a good book on Code Generation! Review: Most of us (software engineers) have been using or creating code generators for years now, but there has never been much published about the practice. Jack Harrington's 'Code Generation in Action' changes that. The first part of the book is reminiscent of the Design Patterns book. The author identifies several code generation 'patterns' or types of code generators. The second part of the book takes more of a 'cookbook' approach. Each of the generator types introduced in Part 1 is implemented with practical examples (mostly web-related). The examples implemented are not trivial 'toy' examples either. Some might find the choice of Ruby as an implementation language problematic, however I found it quite appropriate. The Ruby example code is very readable, clear and there are line-by-line descrtiptions of what's going on in the code. As a side benefit you can learn Ruby in a practical context - Ruby has been generating a lot of buzz in the last couple of years and this book offers some good reasons why. Bottom line: If you haven't been doing code generation, this book will be a great introduction to the practice. If you have been doing code generation this book will offer you a lot of new ideas to ponder.
Rating:  Summary: Great introductory material on code generation Review: The introduction and motivation are quite compelling, though a bit more detail on the dismissal of passive code generators (i.e. wizards) and focus on active code generators would be nice. The examples are also quite practical and seem high quality, though the use of Ruby is going to be a barrier to some. There was one guest-written chapter that might as well have been elided, or should at least have been more edited to integrate cleanly. It repeated a lot of what had been said earlier, and could've just jumped straight to the point instead. Finally, the code samples were a little repetitive in places. I would've preferred the book were shorter, with more info at the level between high-level and code (i.e. what does it make sense to paramaterize, and how should your generator work) rather than focusing either at the high level of 'architecture' or the low-level of 'how a single variable replacement works'. Still, an excellent book, and quite a good introduction for those who don't use code generators already.
Rating:  Summary: Good book with the right perspective and plenty of examples Review: The writing is precise and clear with annotated examples everywhere. Positioning and justification of various techniques is very compelling. The author's classification of various forms of active code generation clearly elucidates the potential of Code Generation. Usage of templates for code generation is an excellent suggestion. Explanations on various code snippets and regex macros are simply second to none. Chapters 3, 4, 5 and 10 are a must read for every developer. Having implemented a large-scale database conversion from IDMS to DB2 (schema, data dictionary, run time and programs) using home grown automated generators in the past, I really enjoyed reading Chapter 10. I completely agree with the assertions made there and I am impressed by the way the author addresses common concerns. This chapter documents a practical approach to ease the burden of writing repetitive code for code heavy frameworks. Schema Oriented Code Generation is a practical approach to code generation. I also find various references in this Chapter and others extremely valuable. The author has shown that with sufficient metadata about a system, a significant portion of the repetitive coding tasks relating to data access, user interface, test and documentation can be automated in a consistent manner using custom code generators. It is refreshing to see code snippets in Ruby. The author's selection of Ruby becomes self evident after reading the various code snippets. I find this to be a very compelling book and a must have for architects and seasoned developers!
Rating:  Summary: Ultimately Disappointing Review: There are things I like about this book, and the topic is certainly timely, but this falls down the same rabbit hole many books do: the examples are just paltry and do not add up to a book-length treatment. Little is done to convince the reader that the code generation option in each case was the best solution. For instance, in the case of SQL statements, there are countless other options. What makes this approach superior? One gets the feeling that the answer is the author just needed another example to paper his undertaking with. Some of the sections are downright preposterous in their brevity. There's a section on generating Swing dialog boxes. It contains almost nothing but a silly diagram that looks like a data flow. A good book on this subject would have used a real object oriented language to implement the generators, and would have showed the abundant design patterns that would apply to this problem (Builder, Bridge, etc.). One imagines that there could be many reuse opportunities in the generation framework. Code generation in some of the proto-MDA tools (like Eclipse's EMF, for instance) or the JET project show a lot more promise.
Rating:  Summary: Not very useful when the examples are written in RUBY!! Review: There's a lot of why and what but almost no "how" here, unless you want to learn a language called Ruby. He doesn't even give much in the way of Ruby code, either. It's mainly a lot of complicated program diagrams that look like an ad for Visio. If you want to read ABOUT code generation, buy it. If you want to see actual code generation, skip it. Sorry, I can't jump on this bandwagon.
Rating:  Summary: Not very useful when the examples are written in RUBY!! Review: There's a lot of why and what but almost no "how" here, unless you want to learn a language called Ruby. He doesn't even give much in the way of Ruby code, either. It's mainly a lot of complicated program diagrams that look like an ad for Visio. If you want to read ABOUT code generation, buy it. If you want to see actual code generation, skip it. Sorry, I can't jump on this bandwagon.
Rating:  Summary: Necessary book Review: This is an excellent book for those interested in learning practical applications and techniques of code generation. You'll find a comprehensive introduction to all the various aspects and types of code generation along with a good mix of high-level explanation and rationale backed up with detailed concrete examples. In fact, it was a pleasant surprise to find non-trivial examples packed with useful insights. As a long time user of code generation, I came away with new ideas that will help me on future projects. In more than one case, I was humbled to find that I had overlooked what now seems like an obvious approach to some common problems I had worked on in the past. In some ways this book reminds me of the Design Patterns book in that although many of the ideas were out there in people's heads no where was it documented, explained, and demonstrated so that the wheel doesn't need to be constantly re-invented. For this reason I believe that this book is necessary. It has the potential of making you a better programmer.
Rating:  Summary: Excellent for Java Developers! Review: This is the first book I found that looked worth purchasing on the topic of Code Generation. I live and breathe in the Java World, and this particular subject is increasingly interesting when designing complex applications for long-term scalability and maintainablility.
The author presents this subject cleanly from very simple beginnings to more complex solutions that really made me rethink the subject and left me with a much clearer idea about how to proceed in the future. I am now looking very hard at Ruby! It's by my desk now until I can get it memorized!
|