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 the implementation needs. Factories is very common. Anytime you are … Continue reading Design patterns in TypeScript: Factory