Design patterns in TypeScript: Factory

A Factory hides the details of instantiating objects within a class hierarchy. The client provides some information regarding the object it needs. Based on that information the factory determines which class of objects to instantiate and how to go about it. Factories are typically Singletons but don’t necessarily need to be, and it depends on … Continue reading Design patterns in TypeScript: Factory

Design patterns in TypeScript: Chain of Responsibility

In event-driven systems messages produced by one object can be handled by one or more other objects. None of the objects need to know of one another – all they need to share is a common mechanism for distributing messages. Messages are sent from one object to another making them part of a chain. This … Continue reading Design patterns in TypeScript: Chain of Responsibility

Singletons in TypeScript


A singleton[1] is a pattern that guarantees there is a single instance of an object in the system. A singleton can maintain a state which is shared across the entire system. Singletons abstract their internal workings from the rest of the system. Singletons are common in business applications. They help model real-life business processes that … Continue reading Singletons in TypeScript