Chapter 3

Patterns

Publisher Summary

This chapter focuses on the techniques and principles of building high-quality APIs. It covers a few useful design patterns and idioms that relate to C++ API design. A design pattern is a general solution to a common software design problem. It concentrates on those design patterns that are of particular importance to the design of high-quality APIs and discusses their practical implementation in C++. It also covers C++ idioms that may not be considered true generic design patterns, but which are nevertheless important techniques for C++ API design. The techniques that are used specifically are: pimpl idiom, singleton and factory method, proxy, adapter, and facade, and observer. The chapter also details the ...

Get API Design for C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.