Reader small image

You're reading from  TypeScript Design Patterns

Product typeBook
Published inAug 2016
Reading LevelIntermediate
PublisherPackt
ISBN-139781785280832
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Vilic Vane
Vilic Vane
author image
Vilic Vane

Vilic Vane is a JavaScript engineer with over 8 years of experience in web development. He started following the TypeScript project since it went public, and hes also a contributor of the project. He is now working at Ruff, a startup company building an IoT platform that runs JavaScript on embedded devices.
Read more about Vilic Vane

Right arrow

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 its implementer.

  • Refined abstraction: TextElement, ImageElement

    Extends abstraction with specialized behaviors.

  • Implementer: UIToolkit

    Defines the interface of a general implementer that will eventually carry out the operations defined in abstractions. The implementer usually cares only about basic operations while the abstraction will handle...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
TypeScript Design Patterns
Published in: Aug 2016Publisher: PacktISBN-13: 9781785280832

Author (1)

author image
Vilic Vane

Vilic Vane is a JavaScript engineer with over 8 years of experience in web development. He started following the TypeScript project since it went public, and hes also a contributor of the project. He is now working at Ruff, a startup company building an IoT platform that runs JavaScript on embedded devices.
Read more about Vilic Vane