[Previous] [Next]
The roles and functions of the Bridge design pattern are as follows:
- Abstraction (UserProfileRepository) Defines an abstract interface.
- Bridge (BridgeRepository) Concrete class that implements the abstraction. Its implementation is unique because it defines a corresponding event for each method defined in the abstraction. Upon invocation of a method, the bridge raises the equivalent event that will be recognized by all subscribing implementors.
- Implementor (ExcelWorkbookRepository) Concrete class that defines implementation intended for the abstraction. The implementor subscribes to events published by the bridge. When an event is raised, the implementor executes the appropriate implementation, which is defined in terms of an event handler function.