Abstract
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.
Keywords
Cite this article
@article{cai-1283,
author = {Matuš Chochlík},
title = {Implementing the Factory Pattern with the Help of Reflection},
journal = {Computing and Informatics},
volume = {35},
number = {3},
pages = {653--686},
year = {2016},
issn = {1335-9150},
url = {https://cai.type.sk/content/2016/3/implementing-the-factory-pattern-with-the-help-of-reflection/}
}
TY - JOUR AU - Matuš Chochlík TI - Implementing the Factory Pattern with the Help of Reflection JO - Computing and Informatics VL - 35 IS - 3 SP - 653 EP - 686 PY - 2016 SN - 1335-9150 UR - https://cai.type.sk/content/2016/3/implementing-the-factory-pattern-with-the-help-of-reflection/ KW - Reflection KW - metaprogramming KW - generic programming KW - design patterns KW - factory pattern ER -
Chochlík, M. (2016). Implementing the Factory Pattern with the Help of Reflection. Computing and Informatics, 35(3), 653–686. https://cai.type.sk/content/2016/3/implementing-the-factory-pattern-with-the-help-of-reflection/