Static Factory Methods | Object-Oriented Programming w/ TypeScript
Last updated Nov 21st, 2019
In this blog post, I explain how we can use the static factory method to enforce rules against how an object is created.
![](/img/blog/templates/banners/typescript-blog-banner.png)
Go read "When to Use a Private Constructor | Object-Oriented Programming w/ TypeScript".
You'll use static factory methods for the same reason you'll want to use a private
constructor.
Discussion
Liked this? Sing it loud and proud 👨🎤.
Stay in touch!
Join 15000+ value-creating Software Essentialists getting actionable advice on how to master what matters each week. 🖖
View more in TypeScript
You may also enjoy...
A few more related articles
![](/img/blog/templates/banners/ddd-blog-banner.png)
How to Handle Updates on Aggregates - Domain-Driven Design w/ TypeScriptDomain-Driven Design
In this article, you'll learn approaches for handling aggregates on Aggregates in Domain-Driven Design.
![](/img/blog/templates/banners/ddd-blog-banner.png)
Decoupling Logic with Domain Events [Guide] - Domain-Driven Design w/ TypeScriptDomain-Driven Design
In this article, we'll walk through the process of using Domain Events to clean up how we decouple complex domain logic across the...
![](/img/blog/templates/banners/ddd-blog-banner.png)
Does DDD Belong on the Frontend? - Domain-Driven Design w/ TypeScriptDomain-Driven Design
Should we utilize Domain-Driven Design principles and patterns in front-end applications? How far does domain modeling reach from ...
![](/img/blog/ddd-intro/ddd-intro.png)
An Introduction to Domain-Driven Design (DDD)Domain-Driven Design
Domain-Driven Design (DDD) is the approach to software development which enables us to translate complex problem domains into rich...