The design is in the code: enhanced reuse techniques in C++

Extreme Programming emphasizes the coding activity in all its aspects. It would be useful, then, if new coding techniques could render the code higher-level, more compact, more reusable, and easier to change. This paper describes policy classes in C++ a new approach that combines generic programming and object-oriented techniques. The end is to make it easier to express and convey design entities directly in code. Using policy classes, library writers can make it possible to better achieve the "write once and only once" goal provide high-level, powerful, extensible libraries. Leveraging design patterns [1] and language-specific idioms as recipes for successful solutions, generic libraries using policy classes truly democratize good designs. The example used throughout this paper is defining a truly generic, flexible, portable smart pointer a popular C++ idiom and an incarnation of the Proxy design pattern [2]. Pre-requirements Good knowledge of C++ and OOP design. Acquaintance with design patterns.