Photo by Earl Wilcox on Unsplash

Domain modeling for frontend applications using TypeScript

Osman Cea

--

Thanks to Rafael Poveda and Abel Fernández for proof reading this article ❤️

One of the most rewarding things about using TypeScript instead of plain old JavaScript for writing frontend applications, is the ability types give us to model the business in terms of code. Sure, type-safeness and code hinting — which are two benefits we get from using a statically typed language like TypeScript — , have a strong case for improving the quality of your codebase and developer experience correspondingly. In my experience building applications with JavaScript and TypeScript, what I’ve found most value in when using types, is domain modeling.

Good domain modeling not only serves as great documentation: it also brings the business closer to the developers. When developers become business experts, incidental complexity decreases, as they have a better understanding of what they’re trying to solve through software. Good domain modeling is only possible when developers understand the business.

These ideas around domain modeling come from domain-driven design. This article by Martin Fowler is a good starting point if you want to learn more about it.

Regarding big old large business applications, most times your business logic will be in the backend, however there’s much value in…

--

--