Item description for Code Generation in Action by Jack Herrington...
Overview Describes how code generators are used in user interfaces, remote procedure access, and database access, and shows how to use programs to write other programs.
Covering technique and implementation for building code for complex applications frameworks, this book demonstrates how to build high-quality output that is consistent and maintainable. Lessons on abstracting the design of the code so that multiple outputs can be created from a single abstract model of the application functionality are provided. Techniques that range from using simple code processors to handle common coding problems to creating more elaborate and complex generators that maintain entire application tiers are covered. Topics such as building database access, user interface, remote procedure, test cases, and business logic code are also addressed, as is code for other system functions. Although code generation is an engineering technique, it also has an impact on engineering teams and management, an aspect of code generation that is covered in depth in this resource.
Promise Angels is dedicated to bringing you great books at great prices. Whether you read for entertainment, to learn, or for literacy - you will find what you want at promiseangels.com!
Est. Packaging Dimensions: Length: 1" Width: 7.25" Height: 9" Weight: 1.35 lbs.
Release Date Jul 1, 2003
Publisher Manning Publications
ISBN 1930110979 ISBN13 9781930110977
Availability 0 units.
More About Jack Herrington
Jack Herrington is an engineer, author and presenter who lives and works in the Bay Area. His mission is to expose his fellow engineers to new technologies. That covers a broad spectrum, from demonstrating programs that write other programs in the book Code Generation in Action. Providing techniques for building customer centered web sites in PHP Hacks. All the way writing a how-to on audio blogging called Podcasting Hacks. All of which make great holiday gifts and are available online here, and at your local bookstore. Jack also writes articles for O'Reilly, DevX and IBM Developerworks. Jack lives with his wife, daughter and two adopted dogs. When he is not writing software, books or articles you can find him on his bike, running or in the pool training for triathlons. You can keep up with Jack's work and his writing at http: //jackherrington.com.
Jack Herrington currently resides in Union City, in the state of California.
Reviews - What do customers think about Code Generation in Action?
Useless Feb 23, 2007
Two problems with this book:
1. The language -- Ruby -- is a strange choice. I've been writing and using code generators, in some form, for decades; I've used mmm... let's see: dBase, C, C++, awk, and perl, alone and/or in combination. These, I believe, are the more-or-less mainstream languages that could be appropriate as a platform for a book on code generation (and text processing in general). But Ruby? Life's short! One has to prioritize, ruthlessly sometimes: -- I don't know Ruby, I don't need Ruby, and don't want to waste my time on learning it just for the sake of reading this book. And, consider this: for every person knowing Ruby, there's gotta be at least a thousand knowing perl, so: Why Not Perl?
2. Code generation cases the author demonstrates are, w/o exception, way too primitive and inadequate for typical real-life needs (for example, in the unit-test section he generates tests for something like funcAdd( addend1, addend2 ) should be equal addend1+addend2; is that practical, useful? It's easy to test, yes, but that's not what we, the silent majority, tend to be writing -- and how do you generate unit tests for something more realistic? The author demonstrates solutions to far-fetched and unrealistically primitive cases, while skirting the real issue of unit-testing in a realistic context. Can you automate testing of anything more involved than 2+2 must be = 4? Studied silence on that, I still don't know, testing 2+2 does not lend itself to easy extention into higher semantic complexity.... so what use is this book?
Bottom line: Good topic; audacious promise; no delivery. Thumbs down, not recommended.
Reader with another perspective Aug 19, 2005
Prospective buyers that are discouraged by some of the negative reviews may be encouraged by a perspective I have gained from writing code that writes code:
--I find it usually does not matter as much how fast a code generation tool performs, but rather that the code it generates has good performance (with exceptions of course).
--Since I'm writing a tool to save time, and often for "internal" use, I tend to prefer using one or more simple, expressive languages for the job, and Ruby is one such language.
--Whether the book's examples suit real life situations is arguable and I don't care so much either way, but if you instead view the book as an opportunity to see more creative approaches to solving problems by writing tools to solve your problems, I find that mindset to be valuable.
Excellent for Java Developers! Jan 10, 2005
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!
Poor choice of tools; code not very useful Dec 17, 2004
I have been doing language parsing and generation in C for several years: English, French, Japanese, Chinese, Korean. Still, I hoped to learn something new from CGIA for Java. I was disappointed. I think the book misdirects the reader away from more effective solutions into less productive paths.
The book suffers from two problems. (1) the regular expression technology proposed is inappropriate (2) the exercises provided are not rich enough to be useful.
I have no objection to scripting languages. I have happily used bash, gawk, python/Jpython and php. I avoided perl because I was struck by its lack of readability and writability. Ruby is no better and no worse than many scripting languages, but the documentation and error messages leave very much to be desired. CGIA offers almost nothing in the way of real help with the language. It took me some time to figure out how to install the libraries properly and debugging was a nightmare! Ruby's regular expression language is yet another variation in the regex language Babel. This is not something I would foist on developers in my organization. Especially when there are much better alternatives.
For years I have been using lex (flex actually) in C for code generation and human language processing. (I have never had much use for YACC/Bison.) When I switched to Java, I found an excellent flex equivalent called JFlex (http://jflex.de/). JFlex.jar is around 240K. The regular expression language for JFlex is extremely close to that of lex and gawk. It is much more readable and modular than that of ruby, perl, etc. Your Java programmers and maintainers need not learn a new language or download/install/configure an additional 28 MB of libraries. Even better, they can use JFlex in runtime production code, since it produces compiled FSA's which are orders of magnitude faster than an interpreted regex processor like ruby.
Additionally, you can get with lex/flex/JFlex full grammars for C++ and Java, not the superficial variable reader that came with CGIA. And the debugging mode, while not perfect, is quite usable. (There are commercial visual tools for debugging flex grammars, if you need and can afford them.)
From the code point of view, I found nothing usable in CGIA. In my judgment most of the examples were more suited to the classroom than to work, and the solutions presented were often not competitive with alternatives. On the theory/fundamentals side the book does not contribute much to the the understanding of language parsing or generation issues.
The arguments for using code generation are cogent. But if you want to use a more useful, popular, constantly evolving (but equally poorly documented) code generation system, go for XDoclet.
My recommendation: skip CGIA. Spend your time and money learning flex/JFlex for parsing and XDoclet for generating and you will be much better off. If you want theory, sink your teeth into something like the "Dragon" classic (Aho & Ullman).
The Code Generation Bible Sep 14, 2004
Essential reading for anyone interested in learning about code generation - written by one of the world's leading code generation gurus.