|
F
irst
of all, let's clarify what
Generative Programming: Methods, Tolls, and
Applications
is about. What is generative programming (GP)? The authors
it as "a software engineering paradigm based on modeling software system
families such that, given a particular requirements specification, a highly
customized and optimized intermediate or end-product can be automatically
manufactured on demand from elementary, reusable implementation components
by means of configuration knowledge."
In
plain English: The focus is on system families rather than one-of-a-kind
systems. Instead of building a single software system as a solution to
a certain problem, generative programming is about designing a system from
which configurable solutions can be generated based on an assembly plan
or a configuration specification. The problem with current software development
processes is that we usually end up with a concrete software system, but
don't know how we got there. Most of the design knowledge is lost, which
renders software maintenance, evolution, and reuse rather difficult and
costly. In generative programming, the idea is capturing as much of the
production knowledge as possible. Hence GP is about designing and implementing
a generative domain model (preparing for reuse) and designing and implementing
another model for using the generative model to produce concrete systems
(the actual reuse).
None
of that sounds overly familiar, doesn't it? Well, it can't. GP is a new
paradigm and this book (or at least part of it) is the result of a research
project. Hardly anything of what the authors talk about is common practice
today, but it might be in the future. In any case,
Generative Programming:
Methods, Tools, and Applications
is thought-provoking and interesting
reading for those who do not mind being confronted with new ideas and being
overwhelmed with detailed studies of all kinds of aspects related to GP.
Let's
see what the authors cover:
-
Analysis
and Design.
Because GP is about designing and implementing a generative
domain model, the first part of the book is devoted to analysis and design
methods, including domain analysis (determining the scope of the software
system families of interest) and how it relates to object-oriented analysis
and design, and feature modeling (investigating commonalities and variation
among family members).
-
Implementation.
The second and major part is about implementing the system family model.
Although the authors include a discussion of implementation techniques
using all conceivable programming languages, they clearly emphasize C++
programming techniques. The chapters on generic programming, component-oriented
template-based C++ programming techniques, and static metaprogramming in
C++ are among the best coverage of modern and advanced template programming
techniques that we've seen so far. Indeed, the chapter on metaprogramming
impressively demonstrates the potential but also the limitations of template
metaprogramming.
In
stark contrast, there is a chapter about Intentional Programming, an extendible
programming environment developed at Microsoft that allows you to load
extension libraries to add domain-specific programming language extensions
as needed for a given application. Extension libraries can extend the editor,
debugger, etc., and provide an ideal basis for metaprogramming support.
-
Application
Examples.
The third part provides concrete examples of applied generative
programming?all using C++ as an implementation language, heavily using
templates. The examples guide you through all stages of the generative
programming process from domain analysis and feature modeling over domain
design to implementing components, design of domain-specific languages,
and implementation of generators. It's all done in C++, and it looks weird,
but the third example of a matrix computation library comes close to industrial-strength
numeric libraries that exist in practice.
However,
high-speed numeric computations are not every programmer's greatest concern.
So, what's in it for us normal software engineers? The sections about domain
analysis and feature modeling are certainly interesting to those involved
in analysis and design of software systems. The chapters about C++ programming
will, without a doubt, broaden your understanding of template programming.
There is an interesting section (unfortunately rather short) about implementing
design patterns using C++ templates?the kind of stuff you might want to
incorporate into your day-to-day work. The rest of the book is just interesting
reading: very sound, very detailed, probably comprehensive (can't judge,
we're not researchers), maybe academic at times, but by and large valuable,
because it never hurts to prepare yourself for potential, future paradigm
shifts.
Angelika
Langer
develops and teaches classes on advanced C++, STL, multithreading,
internationalization, and Java. She served on the ANSI/ISO C++ Committee
from 1993 to 1998.
Klaus Kreft
is a software architect and consultant
with 15+ years of experience in industrial software development. He works
for Siemens Business Services in Germany. Langer and Kreft are authors
of "Standard C++ IOStreams and Locales: Advanced Programmer's Guide and
Reference" (Addison-Wesley, 1999) and are columnists for
C++
Report
magazine.
|