Questions 1. Consider the WindowAdapter interface (as discussed in the Grand book pp. 181- 182). Figure out how it works. Is this a true adapter or are they using the word a little differently than it is used in the GoF discussion of adapters? 2. The Java Swing GUI toolkit has something they call "pluggable look-and-feel" using a function "setLookAndFeel". This shares the adjective "pluggable" with pluggable adapters as described in the Adapter section in the GoF book. Look at the way pluggable look and feel is used in Java Swing and decide whether this qualifies as a pluggable adapter. Answers: 1. The window adapter class does in sort of a muddled way perform the duties of an adapter as decribed in the GoF book. The GoF book states: “Often the adapter is responsible for functionality the adapted class doesn’t provide.” It also states: “Use the adapter pattern when: you want to use an existing class, and its interface does not match the one you need” You have an interface WindowListener that declares eight methods. You have another class MyWindowClass that only defines two, or sum subset of, the eight methods. You can not use MyWindowClass with the WindowListener interface directly but the WindowAdapter class acts as an adapter making the two “fit” together. It does this by providing its own “do nothing” implementations of the eight methods. I say muddled because, for me at least, I do not have an existing class that does not match the one I need so much as I don’t want to write the “do nothing” implementations myself. Also the WindowAdapter is intended to be subclassed and not used directly. The answer to this question is very gray. 2. On page 144 in the GoF book they describe one way of implementing Pluggable adapters. It states: “ In this approach, TreeDisplay forwards requests for accessing the hierarchical structure to a delegate object.” Swing architecture is rooted in the MVC design pattern. The designers found that because of the tight coupling between the View and Controller it was advantages to combine them into one component. Delegation is used to move some of this components view/controller responsibilities to the separate look-and-feel objects. It is this ability to delegate some of the components responsibilities to separate look-and-feel objects that provides the basis for Swing’s pluggable look-and-feel architecture. Because of this I would say the Swing look-and-feel architecture qualifies as using pluggable adapters.