Is it bad practice to do direct paging on the front end?

0

I have some systems with Java + AngularJS , in some I do pagination in back-end , using pagination of Hibernate , ex:

query.setFirstResult(0);
query.setMaxResults(10);

But recently I found some libraries of AngularJS that do pagination, I did not notice performance difference because I do not have much data to test. This is the library I'm using.

  • Doing front-end paging with these libraries is a bad practice? Why?
  • Can these pages hinder the performance of my system?
  • If they get in the way, when should I use them?
asked by anonymous 28.01.2016 / 20:24

2 answers

3

I think what you should take into consideration when designing a page would be:

  • Amount of information to be displayed;
  • User need to consume all this information;
  • Agility to get new results with the same agility you would have when just displaying new data;

AngularJS is very good in this respect because you can control the amount of results displayed in ng-repeat through the limitTo filter. It is more than proven that ng-repeat has a great impact on performance when badly used and / or with large amounts of data. So, in this case, bad practice is more closely associated with how%% is used than with% as a%.

I think you should especially take into account the user's need to consume this information. A portfolio page, news, for example, is different from the pagination of a search. In the portfolio it is more common for the user to navigate through the results, whereas in a list of search results, if it is not found in the first few views, it is more likely that a new search will be done instead of a navigation. As is the case with the 2nd page of Google.

Then try to answer the following:

  • How long is your data list to the point of creating a performance bottleneck?
  • How many tabs will the user navigate?
  • What is the speed between "adding +1 page" vs. "making another request"?

Changing only the limit amount of the filter ng-repeat you have the display of more data well to say instantly.

I find it difficult to have a case where it is easier to make front-end in steps, than to make limitTo integer at the beginning. Even nowadays, it is difficult for anyone to navigate a list that is so long that it is unlikely to carry it all in one go. There is patience ...

    
28.01.2016 / 20:39
3
  

Doing front-end paging with these libraries is a bad   practice? Why?

By no means is it a bad practice. It all depends on the amount of data being retrieved from the server. This should be your guide when evaluating paging client or server side

Do not believe when they tell you that server side is always the best option, because if the amount to be retrieved from the server is not great, then why complicate your life by having to implement pagination in Hibernate if you can delegate it to a library like this one or several others? The jqGrid library, for example, works fine with both options.

If your system consists of multiple registration tables, then for those that should display very little data (eg

28.01.2016 / 20:41