Currently, I am working on a project that involves client-server communication via rest API, with Angular 2 calling restful web services as the primary method. The client side is written in Typescript, which is a subset of JavaScript.
My main challenge lies in the complexity of our nested server-side objects, making it difficult to properly model and deserialize them on the client side when receiving JSON responses.
This raises several questions for me:
Is it necessary to create a class on the client side for each JSON response object and perform deserialization before binding it to the HTML view or processing the data?
What level of complexity or size can the response JSON object reach before it becomes a performance issue or violates best practices?
I am still uncertain about how to distribute workload between the client and server. What factors determine whether a task should be handled on the server side or delegated to the client? In many scenarios, the server could fetch large amounts of data before sending it to clients, or should I allow the client to make multiple requests and handle fetching on its end? The application I am developing is intended for an intranet environment with approximately 1000 users (5-10 concurrently).
Given my limited experience with web applications utilizing REST, any guidance or advice on these matters would be greatly appreciated.