Roles

[Previous] [Next]

The roles and functions of the elements of the Adapter design pattern, as well as how they relate to the elements in the scenarios discussed previously, are as follows:

  • Client Collaborates with all objects that implement the expected interface.
  • ExpectedInterface (Map) Defines the interface expected by the client.
  • Adapter (SMap) Serves as a bridge between a client that requires a specific interface (ExpectedInterface), and other classes, objects, and functions that contain the functionality desired but would otherwise be impossible to leverage because the interfaces they expose are incompatible with the interface the client expects.
  • Adaptee (Collection) Contains functionality that is useful to the calling client. An adaptee might be in the form of a class, object, or function. However, because the interface exposed by the adaptee is incompatible with the interface expected by the client, interaction is possible only indirectly through the adapter.


Microsoft Visual Basic Design Patterns
Microsoft Visual Basic Design Patterns (Microsoft Professional Series)
ISBN: B00006L567
EAN: N/A
Year: 2000
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net