
Bridge Use Case : Design Patterns in TypeScript
Design Patterns In TypeScript (book)
https://www.amazon.com/dp/B0948BCH24 : ASIN B0948BCH24
https://www.amazon.com/dp/B094716FD6 : ASIN B094716FD6
Documentation : https://sbcode.net/typescript/bridge/#bridge-use-case
In this example, I draw a square and a circle. Both of these can be categorized as shapes.
The shape is set up as the abstraction interface. The refined abstractions, Square and Circle, implement the IShape interface.
When the Square and Circle objects are created, they are also assigned their appropriate implementers being SquareImplementer and CircleImplementer.
When each shape's draw method is called, the equivalent method within their implementer is called.
The Square and Circle are bridged and each implementer and abstraction can be worked on independently.
#bridgePattern
#typescriptBridge
#bridgePatternTypescript