Figure 6.2 illustrates how to decouple the view from the rest of the world by having the view communicate to an interface called "adapter". A controller object, Frame3Controller connects the view Frame3 to the world by installing a concrete adapter into the view. The adapter is instantiated as anonymous inner object and has access to all of its outer object. The view does not and should not know anything about the world to which it is connected. This adds fexibility to the design.
Available under Creative Commons-ShareAlike 4.0 International License. Download for free at http://firstname.lastname@example.org
Note: Click here to view Frame3.java, or download the entire archive
Figure 6.2 Frame3