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.
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.
Singleton, Factory Method and Abstract Factory in TypeScript, with run listings: why the Singleton breaks tests and which alternative to choose instead.
Builder, options object and Prototype in TypeScript: run examples of shared-array bugs, a parameterized query builder, and shallow versus deep copies.
Adapter, Decorator and Facade in TypeScript with run listings: unit conversion traps, the order of stacked decorators, and a facade that compensates errors.
Composite treats files and folders through one interface, Bridge separates two axes of variation: run TypeScript examples, typical defects and when to skip.
Observer notifies listeners when data changes, Strategy picks the algorithm at runtime: TypeScript examples, typical failures, and when to skip them.
Command with undo and redo, Chain of Responsibility as middleware, and Template Method in TypeScript: run listings, typical errors and lighter alternatives.
Have you read all the articles? Check how much you've learned by taking this series' quizzes.