Should I create objects from the data returned by API?

时间:2019-02-21 05:00:17

标签: angular rest frontend

Sorry for the rookie questions...

I'm writing my own front-end as a side project and I'm making a REST API call to my back-end API.

I get a JSON array back from the API containing 'Game' data, and it got me thinking...

Should I create objects from the JSON data I've received from the API? I could loop through the JSON array and create a new Game object for each index. Is this good practice?

Or should I just create front-end objects using the raw JSON data from API?

Is this why MongoDB is popular since you can 'store objects'?

0 个答案:

没有答案