One advantage to using the Bridge design pattern is that ActiveX-enabled programming languages that do not support interface inheritance can now benefit from interface reuse.
Implementation inheritance, which is not supported by Visual Basic, provides reuse of implementations through a class hierarchy. A descendant class could potentially reuse implementations from all ancestor classes in its inheritance chain. Using the Bridge design pattern, you can accomplish the implementation reuse by having multiple implementor classes subscribe to the same event published by a single bridge. Each implementor class's event handler will be called as a result of a single client request.
The Bridge design pattern accomplishes the decoupling of an interface from its implementation, which results in the following benefits:
These benefits are also realized through interface inheritance and through the COM and ActiveX technologies that are an inherent part of Visual Basic. By using polymorphism, an interface can bind dynamically at run time to an object that supports it. Interfaces are made available through type libraries, and different components can all reference the same type library. This ability allows the components to define and change their implementations at will and requires a recompile of only the changed component. The only thing missing is the granularity at which an interface can bind to an object.
The Bridge design pattern adds this granularity. Implementations for all properties and methods of an interface are no longer bound to one class module. In other words, the Bridge design pattern allows a client to have a reference to a single instance of a bridge object that supports the interface the client expects. Yet the implementation for each property and method of the expected interface can be dispersed among different class objects. As a result,
To avoid these potentially unacceptable results, you should make certain design decisions before you implement the Bridge design pattern. For instance, if you intend to have multiple implementors to implement parts of an interface, the bridge should provide default behavior if no subscribing implementors exist. Also, you should have the state reside solely in the bridge.