D
D
Dmitrii Solovev2016-06-16 20:03:47
Angular
Dmitrii Solovev, 2016-06-16 20:03:47

Which of the two options for working with data in Angular should you choose?

Here I see two options for an application on angular:
1) As if it were a regular site, but instead of html we drive json. That is, every time a state is changed, a request is made and the necessary data is loaded for a particular state.
+ Data is always up-to-date
+ Less work with logic when there are many data dependencies
- More requests
...
2) We load the data once and then when updating, deleting, adding, we do it on the client and on the server. There is some synchronization.
+ Fewer requests
- The need for a bunch of logic, when updating one object entails updating three or more more
- Conflicts, out of sync and a slight irrelevance of data are possible if we simply go through the states without performing actions
- Еще большие проблемы, если начинать реализовывать пагинацию, сортировку и прочие не простые штуки

Возможно я упустил некоторые плюсы и минусы, подскажите пожалуйста, какой из этих способов предпочтительнее? какой обычно используется в "бою"?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Сергей Протько, 2016-06-16
@dimonnwc3

1st option. The second one is only if you really need offline support and it is done on top of the first one.
The cons of the first option are ridiculous compared to the pros and cons of the second. There is such a thing as caching.

A
al322se, 2016-06-20
@al322se

For the second option, there will be less synchronization fuss if you use www.getbreezenow.com/breezejs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question