For several reasons it is attractive and interesting to represent classes as objects that are on equal footing with the objects that are instantiated from the classes.
The class of an object, which represents a class, is usually called a metaclass. In this section I will discuss how to simulate metaclasses and how to simulate classes as objects. I will also demonstrate how to simulate the upper part of the class hierarchy, which ties the whole object-oriented framework together. Finally, I will show how to instantiate classes via message passing to the object, which represents the class.