In sum, the paper proposes three design principles for how to implement
Background: metaprogramming in OOP
See also
A metaobject is an object that manipulates objects (including itself!). It can change an object’s type, interface, class, methods, attributes, …
The metaobject protocol (MOP) provides the vocabulary to access and manipulate objects. Functions of an MOP include:
- Creating/deleting new classes
- Creating new properties/methods
- Do inheritance
- Generate/change code defining methods of a class
Different implementations of a metaobject protocol can allow for different behaviors when a class is created. For example, if you want a hash table or non-hash table representation of a class, you can use different MOPs.
Mirror-based APIs
In Java, reflection methods are inherent to Class
. In JDI (Java Debugging Interface), they make reflection items (Class
, Method
, etc.) interfaces, allowing for different concrete representations of the reflected items for e.g., different platforms. Benefits:
- Encapsulation. Meta-level facilities encapsulate their implementation
- Stratification. Meta-level facilities are separated out, e.g., to minimize bin size.
- Structural correspondence. Every language construct is mirrored, including things like modules, import/export statements, statements, …