Abstract
Reflection deals with obtaining information about executing programs. This includes static information such as the structure of types, fields and methods as well as runtime information such as the contents of the activation stack and the heap.
We show a simple technique for accessing this metainformation in a uniform way. The general idea is to organize the metainformation as a nested sequence of elements that can be traversed using iterators (so-called riders). Instead of keeping metaobjects in main memory we store them in a reference file and let the iterators parse the file. In this way, reflection imposes only a negligible memory overhead. Users don't have to pay for this feature if they don't use it.
In contrast to some other reflection models iterators not only allow us to explore the static program structure but also the runtime data. For example, an iterator can traverse the activation frames on the stack, zoom into a particular frame, traverse the variables in this frame, zoom into a structured variable and so on until the desired information is found.
Our reflection model has been implemented for the Oberon system and has been used for a number of system programming tasks including a general IO module, an exception handling mechanism and a database binding.
Original language | English |
---|---|
Title of host publication | Dagstuhl Seminar 451 on Effective Implementation of Object-Oriented Programming Languages |
Publication status | Published - 2000 |
Fields of science
- 102 Computer Sciences
- 102009 Computer simulation
- 102011 Formal languages
- 102013 Human-computer interaction
- 102029 Practical computer science
- 102022 Software development
- 102024 Usability research