Implementing the Factory Pattern with the Help of Reflection
Matúš Chochlík; Department of Informatics, Faculty of Management and Informatics, University of Žilina
Computing and Informatics, Tome 34 (2016) no. 4, / Harvested from Computing and Informatics
Reflection, reflection-based programming and metaprogramming are valuable tools for many programming tasks, like the implementation of persistence and serialization-like operations, object-relational mapping, remote method invocation, automatic generation of user-interfaces, etc., and also for the implementation of several design patterns. C++ as one of the most prevalent programming languages still lacks support for standardised, compiler-assisted reflection. In this paper we introduce in short the Mirror reflection library which is a part of an ongoing effort to add reflection to C++ and we will show how reflection can be used to greatly simplify the implementation of object factories - classes constructing instances of other classes from various external data representations.
Publié le : 2016-11-02
Classification:  Programming paradigms; Software engineering;,  Reflection, metaprogramming, generic programming, design patterns, factory pattern
@article{cai1283,
     author = {Mat\'u\v s Chochl\'\i k; Department of Informatics, Faculty of Management and Informatics, University of \v Zilina},
     title = {Implementing the Factory Pattern with the Help of Reflection},
     journal = {Computing and Informatics},
     volume = {34},
     number = {4},
     year = {2016},
     language = {en},
     url = {http://dml.mathdoc.fr/item/cai1283}
}
Matúš Chochlík; Department of Informatics, Faculty of Management and Informatics, University of Žilina. Implementing the Factory Pattern with the Help of Reflection. Computing and Informatics, Tome 34 (2016) no. 4, . http://gdmltest.u-ga.fr/item/cai1283/