Introduction to OOP
Chapter 25: Reflection and Introspection :
next
previous
audio
real
text
Rational for Metaclasses
Remember that by introducing new classes that represent classes, Smalltalk was able to solve the following problem
How do you give unique behavior to just one instance of a class?
(For example, the behavior to initialize newly created instances of a class).
The answer was, you don't. You add a new child class that defines the behavior you want, and put this between the object and the true parent.
Intro OOP,
Chapter 25
, Slide 11