A Pattern for Static Reflection on Fields: Sharing Internal Representations in Indexed Family Containers
Paper i proceeding, 2007

Reflection allows defining generic operations in terms of the constituents of objects. These definitions incur overhead if reflection takes place at run time, which is the common case in popular languages. If performance matters, some compile-time means of reflection is desired to obviate that penalty. Furthermore, the information provided by static reflection can be utilised for class generation, e.g., to optimize internal representation. We demonstrate how to provide static reflection on class field properties by means of generic components in an OO language with static meta-programming facilities. Surprisingly, a major part of the solution is not specific to the particular task of providing reflection. We define the internal representation of classes by a reworked implementation of a generic container that models the concept of a statically indexed family. The proposed features of this implementation are also beneficial to its use as a common container.

High Performance

Generative Programming

Static Reflection

Serialization

Container

Författare

Andreas Priesnitz

Chalmers, Data- och informationsteknik, Datavetenskap

Sibylle Schupp

Chalmers, Data- och informationsteknik, Datavetenskap

2nd International Conference on Software and Data Technologies, ICSOFT 2007; Barcelona; Spain; 22 July 2007 through 25 July 2007

Vol. PL DPS/KE//- 30-37

Ämneskategorier

Programvaruteknik

Datavetenskap (datalogi)

Mer information

Senast uppdaterat

2024-07-12