Are inheritance and delegation equally powerful?
An obvious question to ask about the preceding discussion of inheritance and delegation is whether the two techniques have the same expressive power. The answer is no. Given delegation, it is easy to see how we could implement the functionality of inheritance. We can create special class objects that respond to messages to create new instances. We need only arrange that the class objects observe the copying of variables from the superclass chain when they create instances. Instance objects are given behavior that implements the lookup methods, roughly as follows.