Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 3. Adapter Pattern > Problem and Solution

3.1. Problem and Solution

In an application, you may be a working code base that is architecturally sound and stable. However, new functionality is constantly being added that requires use of these existing objects in a different way than they were originally designed. The roadblock may be as simple as the new functionality expecting a different name of a function. It could also be a bit more complex scenario, where the functionality expects slightly different original object behavior.

The solution is to build another object, using the Adapter Design Pattern. This Adapter object works as an intermediary between the original application and the new functionality. The Adapter Design Pattern defines a new interface for an existing object to match what the new object requires.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint