Skip to main content

Design Patterns in TypeScript

Six articles on the GoF patterns in TypeScript, with listings that were run: Singleton and Factory, Builder and Prototype, Adapter, Decorator and Facade, Composite and Bridge, Observer and Strategy, Command, Chain of Responsibility and Template Method.

This series collects 6 articles (approximately 94 minutes of total reading time), designed for a level Intermediate. The main topics covered are Design Patterns, GoF, TypeScript, Creational.

6Articles94 minTotal reading timeIntermediateLevel
Design PatternsGoFTypeScriptCreationalStructuralBehavioral

Series Articles

  1. 1

    01 - Singleton and Factory Pattern: Controlled Object Creation

    Singleton, Factory Method and Abstract Factory in TypeScript, with run listings: why the Singleton breaks tests and which alternative to choose instead.

  2. 2

    02 - Builder and Prototype Pattern: Flexible Construction

    Builder, options object and Prototype in TypeScript: run examples of shared-array bugs, a parameterized query builder, and shallow versus deep copies.

  3. 3

    03 - Adapter, Decorator and Facade Pattern: Flexible Structures

    Adapter, Decorator and Facade in TypeScript with run listings: unit conversion traps, the order of stacked decorators, and a facade that compensates errors.

  4. 4

    04 - Composite and Bridge Pattern: Hierarchies and Separation

    Composite treats files and folders through one interface, Bridge separates two axes of variation: run TypeScript examples, typical defects and when to skip.

  5. 5

    05 - Observer and Strategy Pattern: Flexible Behavior

    Observer notifies listeners when data changes, Strategy picks the algorithm at runtime: TypeScript examples, typical failures, and when to skip them.

  6. 6

    06 - Command, Chain of Responsibility and Template Method

    Command with undo and redo, Chain of Responsibility as middleware, and Template Method in TypeScript: run listings, typical errors and lighter alternatives.

Test your knowledge!

Have you read all the articles? Check how much you've learned by taking this series' quizzes.

Take the quiz!