Open Jtcruthers opened 4 years ago
DTO? Got any articles or something?
Data Transfer Object. Just like some class that both FE and API implement. Then its ez to respond in json via api and cast from json in the fe.
The spirit of this was we should have a defined class and use that. Then when we change weather apis, we just have to map their api to the class's attributes.
We should create some standard DTO between the api and fe. Right now we kinda just pass through the data from the weather api. If we standardized it and created an interface, we could use different APIs and strip out what we need only for the DTO. This will also help remove some of the noise and create a smaller, better defined response.