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

7. The Adapter and Facade Patterns: Bein... > Tools for your Design Toolbox

Tools for your Design Toolbox

Your toolbox is starting to get heavy! In this chapter we’ve added a couple of patterns that allow us to alter interfaces and reduce coupling between clients and the systems they use.

image with no caption

Bullet Points

  • When you need to use an existing class and its interface is not the one you need, use an adapter.

  • When you need to simplify and unify a large interface or complex set of interfaces, use a facade.

  • An adapter changes an interface into one a client expects.

  • A facade decouples a client from a complex subsystem.

  • Implementing an adapter may require little work or a great deal of work depending on the size and complexity of the target interface.

  • Implementing a facade requires that we compose the facade with its subsystem and use delegation to perform the work of the facade.


  

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