Tuesday, Afternoon
Implementing Design Patterns Using C++ Templates
Convention Ctr – 211A
Angelika Langer, Independent Consultant

Originally, templates were introduced to the language in order to express common structure in the form of parameterized types implemented as class templates. Function templates, in addition, allow expression of common functionality. Using the template language feature in C++, behavioral patterns as defined by Gamma et al. can be implemented using templates instead of inheritance and virtual functions. Often, classic object-oriented runtime polymorphism can be replaced by compile-time polymorphism, the effect of which is a considerable gain in runtime performance.

In this tutorial, the alternative template technique is demonstrated using the Strategy pattern as an example of a behavioral pattern and the Interpreter pattern as an example of a structural pattern. The latter will serve as an introduction into template meta-programming and expression template libraries.

Presentation Format: Presentation.

Attendee Background: Participants must be familiar with C++. Basic familiarity with C++ template programming and design patterns will help.

Angelika Langer is a freelance trainer/consultant working and teaching in the area of object-oriented software development in C++ and Java. She is co-author of the book “Standard C++ IOStreams and Locales” released in January 2000, and co-author of a column in C++ Report since 1997. Her teaching is backed by 12+ years of software development in the IT industry, including 5 years of compiler construction and involvement in C++ library development as well as the standardization of C++. She is currently working on a book about advanced Java programming idioms.

at a Glance
Tutorials by Track
Full Description
of all Tutorials
Final Program

 OOPSLA'98 Home