Utilization

[Previous] [Next]

The Bridge design pattern is useful in the following circumstances:

  • The client referencing an interface defined in an ActiveX component is written in a language that doesn't support inheritance. For example, interfaces defined in an ActiveX DLL that has been written in Visual Basic cannot be used in Microsoft Excel 97 because Microsoft Excel 97 Visual Basic for Applications (VBA) does not support interface inheritance.
  • Statically binding an interface to a class is too restrictive. For instance, you might want to do any of the following:
    • Implement only part of an interface.
    • Provide an implementation that is not restricted to one class module.
    • Dynamically assign an implementation to an object at run time.
    • Modify, extend, or replace an interface without having to retrofit those changes in all classes that inherit the interface.
    • Reuse a single implementation with multiple interfaces.


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