Home Page -------------------
[Home Page] - [Reviews Main]
-------------------

Book Review
Designing Components with the C++ STL by Breymann
Recommended
ISBN: 0-201-17816-8       Publisher: Addison-Wesley       Pages: 306pp       Price: £29.95
Categories:   advanced c++    
Reviewed by Sean Corfield in Overload OL27 (Aug 1998)

Target Audience

This book is intended for anyone involved in C++ development who already has a basic (I would say 'intermediate' at least) knowledge of C++. In three parts, the book begins with an introduction the STL, its concepts and components, moving on to a catalog of the STL algorithms illustrated with examples and finishing with examples and discussions about how to build applications and complex components on top of STL. That latter part of the book makes up about half of the book and is where the meat of the material lies. As usual with books of this type, all the code examples are available over the Internet.

The Book

Breymann moves the reader on at a cracking pace - ten pages into the introduction we've already moved from a simple array-based example to a full STL container / algorithm / iterator example with templates and then on to writing our own singly-linked list class with an iterator to illustrate how to make your own containers interact with STL. I initially had a bit of a problem with Breymann's narrative style - an artifact of the translation from German to English - but soon got used to his precise, if occasionally unusually constructed, prose. Regardless of this minor criticism, it is certainly a lot more readable than many of the pure reference materials available on STL.

After the initial introduction of concepts, Breymann lays bare iterators in a compact but comprehensive manner, then moves on to deal with containers. In both cases, the interfaces are explained in detail and certain implementation details are considered, partly to shine light on aspects of the interface but mainly to provide a deeper understanding of how the iterators and containers perform their tasks.

The second, central, section of the book covers all the algorithms of STL in about 70 pages. By its nature, this section is almost strictly a reference manual since their are so many algorithms. Breymann provides intelligent commentary throughout, especially where several similar algorithms need clear explanation of their differences, e.g., the sorting and merging algorithms.

Moving on to the third section of the book, Breymann introduces various algorithms and containers that provide solutions to some of the annoying limitations of the STL specification. In each case he explains the benefits and drawbacks of the approach, illustrating each with clear code examples. A particularly good case in point is the chapter on 'Fast Associative Containers' which are implemented using hashing. Hash-based containers were omitted from the (draft) Standard C++ library mainly due to time constraints and the committee has been publically criticised for this omission. Without grinding any particular axe, Breymann provides full implementations of hash-based containers with intelligent commentary and analysis while conceding that no standard exists for these containers, therefore his are just examples.

In chapter 8, we move on to applications constructed on top of STL, cross-referencers, permuted index generators, thesaurus, matrices and so on. Some of these build on the raw STL, others on Breymann's own extensions to STL. Breymann shows how generic applications can be built that allow selection of implementations (using different STL-like containers) and discusses the performance tradeoffs involved. I was particularly impressed by chapter 11 which deals with data structures and algorithms for handling various types of graph (directed, undirected, cyclic, acyclic, weighted etc). Breymann manages to cram a lot of content into a seemingly tiny amount of pages yet the discussion, and code, make the solutions seem comprehensible to the point of simplicity.

Throughout the book, Breymann presents exercises - most with solutions given in the appendix - that test the reader's comprehension and are often non-trivial. In fact, the book scores highly on the integrity of its examples and exercises by dealing with complete programs that illustrate the concepts and components being described.

There are occasional technical errors (e.g., using 'InputIterator_type' in a template declaration followed by 'Input_iterator' within the body) but these are few and far between so readers are unlikely to be confused by them. The technical reviewers have clearly done a good job but with such a highly technical subject under discussion, one or two errors are bound to crawl by unnoticed.

Conclusion

Although the book is presented as more than a reference manual for STL, it is still a bit dry in places and might have benefitted from more discussion material, expanding it perhaps by a third. That said, it manages to cover a lot of ground in clear, concise text and examples and it should provide something of value to anyone either currently using STL or planning to in the near future. There is no doubt about Breymann's expertise and I certainly found some very useful information in the book, despite my long association with the machinations of the C++ committee - in particular the section on graph algorithms impressed me. For nearly thirty pounds, you have to consider whether it is 'the' STL book to own as there are quite a few around. I don't think it quite lives up to the hype of its title but as a reference manual for STL and a good jumping off point for applications built on top of it, this book deserves a very solid recommendation.
Other Authors with the same surname

Breymann
Designing Components with the C++ STL (revised Edition) by Ulrich Breymann [Not Recommended]  (Reviewed Jul 2000)
Designing Components with the C++ STL by Ulrich Breymann [Recommended with Reservations]  (Reviewed May 1998)


Last Update - 13 May 2001.

To link to this review, please use the URL: http://www.accu.org/bookreviews/public/reviews/d/d002013.htm

Copyright © The Association of C & C++ Users 1998-2000. All rights reserved.

Mirrored from http://www.accu.org/