Search the Products Store

Search the Book Store

Webmaster Book Store Index

Home







Webmaster Book Store > Webmaster books beginning with G

More details of book titled: Generative Programming: Methods, Tools, and Applications

Generative Programming: Methods, Tools, and Applications

Author: Krysztof Czarnecki
Published: 2000-06-16
List price: $64.99
Our price: $53.09
Usually ships in 24 hours
As of: January 07th, 2009 03:12:32 AM
Customer comments on this selection.

Webmaster This book has some cool stuff
This book has some cool stuff and I was quite impressed by the part on functional programming using C++ template. Do you know C++ template has the same computing power as a Tuning machine.

Webmaster wide-ranging in scope, but heavy on C++ templates
This book does cover lots of techniques that fall under the rubric of generative programming, but be warned that there is a strong emphasis on C++ template metaprogramming. If you don't know C++, or are a bit fuzzy on template syntax, you'll be missing a lot. Consider this a C++ template metaprogramming book, with some bonus chapters to put it all in context.

The opening chapters are a bit dull, containing a plethora of acronyms and jargon about various design methodologies, none of which seem to have made any particular impact in the last few years. I tentatively diagnose a mixture of thesis-itis and maybe translation-itis. If it's the former, I wouldn't be surprised to find that this made up part of the introduction or literature review chapter. However, the concept of feature diagrams is quite interesting, as it allows a graphical representation of a design specifying features and other properties (such as whether they're optional), without requiring any implementation (e.g. inheritance or parametric polymorphism), which is not possible with UML. How revelatory this is may depend on how seriously you take UML as a modelling tool, versus a convenient set of boxes and lines for representing class design.

There are also chapters on Aspect Oriented Programming, which is a pretty good survey of the field, and which provides useful motivation beyond logging. Additionally, there's a chapter on generators, which provide a convenient Domain Specific Language for specifying behaviour and performance of software components (list containers is the example in the book).

There's also a rather vacuous chapter on intentional programming, the brainchild of Charles Simonyi. It's an interesting enough idea, sitting somewhere between MDA, the Smalltalk class browser, and a souped-up IDE, but there's been absolutely no progress on it since the book was published, because Microsoft didn't release it, and Simonyi wasn't allowed to take any of the code with him when he left to set up Intentional Software. This chapter is ok on the big idea, albeit a bit breathless given it's not been shown to produce any useful software, but the worked example has all the allure of an Eclipse plugin tutorial.

The above material is sporadically interesting, but often a little pedestrian. However, the real action of the book takes place in the chapters on template metaprogramming in C++, which demonstrates how to generate related families of classes at compile time, using template instantiation and careful use of inlining to avoid inefficient virtual calls and indirection. It's very impressive. There are several examples, including a class hierarchy for a banking domain, and an in depth treatment of a matrix library, which successfully unifies all the types (sparse, full, banded etc.) under one library, while maintaining performance competitive with Fortran.

These C++ chapters demonstrate the ideas of the book in practice most clearly, although it also underlines the need for new tools and language features, given the outrageous ugliness of the compiler/template-abuse that is metaprogramming. On the other other hand, it is kind of cool to see colons, angle brackets and other bits of C++ coalesce into a strange new dialect using the compiler as an interpreter. If you're going to get anything at all out of these chapters, you do need to be comfortable with C++ templates. It would probably also help to have read something like Barton and Nackman's book, 'Scientific and Engineering C++', their unorthodox template designs providing a good warm up for what's in this book.

If you don't program in C++, or don't care for template metaprogramming, you may not find huge value for money in the other chapters. And admittedly, the writing style hardly sets the pulse racing. But if you're looking to do some intellectual stretching before taking on Andrei Alexandrescu's Modern C++ Design (and that's probably a very good idea), step right up!


Webmaster A useful addition
One very important lesson in problem solving is that there is no one method that always works. No matter how good you are at one technique, there will be problems for which it is entirely unsuitable. When applied to programming this implies that anyone who wants to be good at problem analysis and program design should always be on the lookout for new methods.
Generative Programming provides an introduction to a collection of methods that are not commonly known. These methods are not the only possible way to produce high quality programs in a reasonable amount of time, but they are very useful for certain types of problems. Most exciting for me are the feature and aspect based decompositions of a problem.
Aspects and features are not always easily represented in more common analysis tools, as is explain in the book, but a proper understanding of the features and aspects in your program can greatly improve design.
Also useful is an extended discussion of techniques that can simplify code generation for programs that are compositions of features and aspects. This involves selecting the features needed and allowing the preprocessor and compiler to generate code on the fly. In lare software systems, this technique greatly reduces program complexity and improves readability.
While I recommend this book, it is with a few qualifications.
First, just as no other techniques are right for every problem, these are not either. Always check to see if the tools are right for the job before applying them. In this case, the tools in this book are rarely a good choice for small projects or for functions that will only be used one way. They are better suited to creating code that can be reused in a variety of different circumstances, or large libraries of code to support a broad user base.
Second, though the book has a ton of useful information, it is not always the most readable way to present the information. The writing is fairly dense, and spends more time surveying the historical development of some of the tools than I would prefer.
Finally, though the tools presented can be used in a wide variety of languages, the presentation is mainly done in C++. Comfort with the language will be essential for anyone wishing to understand the techniques presented.


Webmaster A+ in content, C- in execution
As it is said in another review, this is a solid (and rather academic) book on the theory behind code generation. Unfortunately, I find it somewhat dated and too focused on C++ templates.

The first part of the book includes a nice introduction to domain engineering (a must for anyone interested in the development of product lines). Here, feature diagrams are introduced to represent variation points without implying a particular variation mechanism (such as inheritance or parametrization in OO languages).

The core of this book deals with different implementation technologies. You will find interesting discussions on generic programming, polymorphism, C++ templates, and aspect-oriented programming. In my opinion, the chapter on AOP is probably the best, since it provides a good survey of different approaches (subject-oriented programming, composition filters, and adaptive [structure-shy] programming) and shows some examples in AspectJ Cool (a precursor of the current version of AspectJ [the Java aspect-oriented extension]) and Dynamic Cool (for Smalltalk).

The chapters on generators elaborate on the transformational model of software development, where software development is seen as series of transformations performed on various representations of a system (i.e. creating and evolving specifications of systems and implementing them). Unfortunately, the authors focus too much on C++ template metaprogramming, which is not too practical (at least for me, mainly a Java/.Net developer). The application examples in the final part of the book also follow this approach despite its limitations regarding debugging and code readability. This limitations are not present in intentional programming, which is also covered in its own chapter. Ideally, IP would enable software source code to reflect the intention that programmers had in mind when developing it, thus simplifying maintenance and allowing programmers to keep a good high-level picture of their programs as a whole. Vapor-ware? Fantasy-ware? Maybe

If you are looking for practical ideas on code generation, this book is probably not for you. It is worth its price, however, if you just want to broaden your perspective on computer programming and are not afraid of hefty academic volumes.


Webmaster No Better Book on Software Engineering C++ that I Know Of
The more experience you have designing and implementing complex software with C++, the harder it is to find well-written and thought-provoking books on the subject, especially with regard to architecture.

The various tomes on design using "Patterns" are useful in a charming, lightweight way, but for making architectural decisions that can impact your designs in a revolutionary manner, look no farther than this book, which I consider to be crucial reading for software architects using C++.

Highly recommended.


Similar Listings

Book cover of Modern C++ Design: Generic Programming and Design Patterns Applied (C++ In-Depth Series).Modern C++ Design: Generic Programming and Design Patterns Applied (C++ In-Depth Series)
Book cover of C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond (C++ In-Depth Series).C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond (C++ In-Depth Series)
Book cover of Beautiful Code: Leading Programmers Explain How They Think (Theory in Practice (O'Reilly)).Beautiful Code: Leading Programmers Explain How They Think (Theory in Practice (O'Reilly))
Book cover of Software Factories: Assembling Applications with Patterns, Models, Frameworks, and Tools.Software Factories: Assembling Applications with Patterns, Models, Frameworks, and Tools
Book cover of C++ Templates: The Complete Guide.C++ Templates: The Complete Guide
Our Webmaster book picks:


Search the Webmaster Products Store
Keywords:   


LCS Amazon Store 2.5 © 2009