August 2009
Intermediate to advanced
281 pages
6h 50m
English
This Unified Modified Language (UML) diagram details a class design using the Adapter Design Pattern (see Figure 3-1).
Note the following about this figure:
The MyObject class contains a public method called methodA(). OriginalConsumer acquires an instance of MyObject and calls methodA() during its doSomething() function.
The NewConsumer class is introduced. Its doSomething() function expects to call a public method of the MyObject instance called methodB() during execution.
The MyObjectAdapterForNewConsumer is created by extending the MyObject class. It then provides a public method called methodB() as expected by NewConsumer. In this simple example, all methodB() does is call methodA().
Read now
Unlock full access