To improve our design, we actually need to apply the SRP.
The SRP is a very important and useful design principle for ensuring code quality, maintainability, and separation of concerns. It is actually the first of the SOLID design principles.
SRP states that a class should have one, and only one, responsibility.
The main benefit of applying the SRP is that when changes need to be applied, they should have a limited impact on the code base.
As we all know, requirements evolve and change over time. Each of those changes also impacts the responsibilities of some parts of the system. If specific parts of your code have many responsibilities, then it increases the chance of those being impacted when something changes. Moreover, having a component with many responsibilities also implies that there is a stronger coupling with other parts of the system, meaning a larger potential impact down the line for your overall code base.
Separation of concerns is important for maintainability, and our goal throughout this book is not only to show you the TypeScript syntax, but also to guide you toward creating better applications with the language, and others for that matter.