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.
[1] James O. Coplien,et al. Multi-paradigm design for C++ , 1998 .
[2] Douglas C. Schmidt,et al. Double-checked locking , 1997 .