Bridge Pattern
Bridge Pattern decouples the abstraction manipulated by clients from functional implementations and makes it possible to add or replace these abstractions and implementations easily.
Take a set of cross-API UI elements as an example:
We have the abstraction UIElement
that can access different implementations of UIToolkit
for creating different UI based on either SVG or canvas. In the preceding structure, the bridge is the connection between UIElement
and UIToolkit
.
Participants
The participants of Bridge Pattern include:
- Abstraction:
UIElement
Defines the interface of objects to be manipulated by the client and stores the reference to ...
Get TypeScript Design Patterns now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.