REVIEW - Data structures and algorithms - with object-oriented design patterns in C++


Data structures and algorithms

with object-oriented design patterns in C++


Bruno R. Preiss



John Wiley & Sons Inc (1999)




Mark Radford


August 1999



The copyright date on the book is 1999, so how the author can write over 600 pages without mentioning the STL is completely beyond me. Instead, the author presents his own container designs, attempting an alternative, object- oriented approach. The design comes across as one originally done with a different language (Java, perhaps?) in mind and then applied to C++. Design patterns are thrown in, but in a rather superficial way. For instance, the way Visitors are implemented, they can support only very simple operations. An example of this is printing objects to an output stream. As long as the objects support a polymorphic output operator, knowledge of the concrete class is not needed. The Visitors presented here could not stand up to operations specific to the concrete type of the visited object being added to the object structure.

In my view there are some serious flaws in the author's approach to designing containers. For example, rather than use templates to provide type-safety, the author takes the approach of using a base class called 'Object'. His containers store pointers to 'Objects'. Of course, this means it is only possible to store objects of types derived from the 'Object' class. Therefore, it is not possible to do anything with the contained objects without first going through a type- laundering process. This, together with a very complex hierarchy of classes, does an excellent job of demonstrating that this is a poor approach in modern C++. It makes the whole thing far too complicated!

In conclusion, if you want a book on data structures, there are better books available. A good example in my opinion is Data Structures in C++: Using the STL by Timothy Budd (reviewed in C Vu of May 1998).

Book cover image courtesy of Open Library.

Your Privacy

By clicking "Accept All Cookies" you agree ACCU can store cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

By clicking "Share IP Address" you agree ACCU can forward your IP address to third-party sites to enhance the information presented on the site, and that these sites may store cookies on your device.