Static and metaprogramming patterns and static frameworks: a catalog. an application

The classic UNIX principle to write code that generates code instead of writing this code yourself [48, Chapters 1, 9] is experiencing a revival. Much research was done, the techniques are better understood now, and the generation tools were refined. This pattern catalog consists of adaptations of the Gang of Four design patterns [27] Abstract Factory, Adapter, Strategy, and Visitor to the metaprogramming level. It shows that replacing runtime polymorphism by static polymorphism helps to lift variation from the code level up to the meta level, where it might more naturally belong to. Some of the patterns proposed are especially useful for facilitating portable code. The patterns shown can be used to build static Frameworks [50]. A simple example is also presented. For all patterns proposed we identified usage examples in popular existing applications or libraries. Each pattern presentation is accompanied with an example. These examples show sample code in C++. The template metaprogramming capabilities of C++ [2, 17, 65] allow us to express both the program and the meta program in the same programming language.

[1]  Dirk Riehle,et al.  A pattern language for tool construction and integration based on the tools and materials metaphor , 1995 .

[2]  Bjarne Stroustrup,et al.  The Design and Evolution of C , 1994 .

[3]  Max Jacobson,et al.  A Pattern Language: Towns, Buildings, Construction , 1981 .

[4]  Robert C. Martin,et al.  Acyclic visitor , 1997 .

[5]  Don Roberts,et al.  Patterns for evolving frameworks , 1997 .

[6]  Ken Auer Reusability through self-encapsulation , 1995 .

[7]  Gregor Kiczales,et al.  Aspect-oriented programming , 2001, ESEC/FSE-9.

[8]  David Abrahams,et al.  C++ template metaprogramming , 2005 .

[9]  Dirk Riehle,et al.  Pattern Languages of Program Design 3 , 1997 .

[10]  T. Cargill Localized ownership: managing dynamic objects in C++ , 1996 .

[11]  David Abrahams,et al.  C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond (C++ In-Depth Series) , 2004 .

[12]  Scott Meyers,et al.  Effective C++: 55 Specific Ways to Improve Your Programs and Designs (3rd Edition) , 1991 .

[13]  Krzysztof Czarnecki,et al.  Generative programming - methods, tools and applications , 2000 .

[14]  Andrei Alexandrescu,et al.  Modern C++ design: generic programming and design patterns applied , 2001 .

[15]  Jeremy G. Siek,et al.  A Modern Framework for Portable High-Performance Numerical Linear Algebra , 2000 .

[16]  Mary Poppendieck,et al.  Lean Software Development: An Agile Toolkit , 2003 .

[17]  W. Richard Stevens,et al.  UNIX Network Programming: Networking APIs: Sockets and XTI , 1997 .

[18]  Richard P. Gabriel,et al.  Writers' Workshops & the Work of Making Things , 2002 .

[19]  John Vlissides,et al.  Pattern hatching: design patterns applied , 1998 .

[20]  Mads Torgersen,et al.  The c# programming language, third edition , 2008 .

[21]  Richard P. Gabriel Writer's Workshops and the Work of Making Things , 2002 .

[22]  Timothy G. Mattson,et al.  Patterns for parallel programming , 2004 .

[23]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[24]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[25]  James O. Coplien,et al.  Pattern languages of program design , 1995 .

[26]  N. Wiener Some moral and technical consequences of automation , 1999 .

[27]  Jeremy G. Siek,et al.  The Boost Graph Library - User Guide and Reference Manual , 2001, C++ in-depth series.

[28]  Eric S. Raymond,et al.  The Art of Unix Programming , 2003 .

[29]  Henrietta Hardy Mrs Hammond The complete guide , 1883 .

[30]  W. Küchlin,et al.  Cross-Platform Development of High Performance Applications Using Generic Programming , 2003 .

[31]  Martin Fowler. Refactoring Improving the Design of Existing Code , 1999 .

[32]  B. F. Castro Buschmann, Frank; Meunier, Regine; Rohnert, Hans; Sommerlad, Peter; Stal, Michael. Pattern-oriented software architecture: a system of patterns, John Wiley & Sons Ltd, 1996 , 1997 .

[33]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[34]  Murray Silverstein,et al.  A Pattern Language , 1977 .

[35]  Bjarne Stroustrup,et al.  Specifying C++ concepts , 2006, POPL '06.