I was reading these best practices for Angular project specifically for understanding models and DTOs.
What I have understood in general from different resources and the above one also is that
- We should have DTO to match exact response structure coming from backend APIs
- We should have model classes to use to show data on the pages and for other operations
The problem is if I follow this approach I will have to then write mapper also for all the DTO to model classes which seems unnecessary effort.
I can easily achieve everything without breaking any design pattern with having any one of DTO or model classes.
Should I follow the best practice to have both DTO and model with so much additional code which is not serving too much of a purpose or can I go with just models or just DTOs being used on all levels and my Angular design will not be considered a bad design?