Sorting logic in web app's offline state?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • guptakvgaurav
    New Member
    • Jul 2014
    • 1

    Sorting logic in web app's offline state?

    Hi.

    We are in process of making a web project, where, one of my friend suggest that sorting of data should be in possible with in client side. So that, n/w traffic can be reduce.

    Now, this seems to be valid suggestion to me, but now my concern is, Do i need to embed sorting logic into a js file and send it along with data and now if user want to sort data, one of the function in js will do this job. This is how i think it should work. Is their any other way also? If you feel this is not valid suggestion, please put your reason too.

    We will use struts2 for the project as web-app framework. Also, it would be nicer if you answer same question keeping in mind Node.js also ( :) ).
  • us hosting
    New Member
    • Jul 2014
    • 10

    #2
    Sorted data will take same amount of bytes as that of unsorted data. How is it going to save bandwidth.

    Comment

    • gits
      Recognized Expert Moderator Expert
      • May 2007
      • 5390

      #3
      in fact this strategy will reduce traffic - since for the sorting there is no further request needed and thus the sorted data don't need to be retransferred again after being sorted on the appserver or database. it does in fact even reduce load on the appserver or database at all that way and puts load to the client.

      and yes - for it to work - the client would need to have the executable sorting logic - probably implemented with JavaScript. This sorting logic can work in different ways - to suggest a 'optimal' way depends on the data-format that is underlying. Do you have only dom-nodes with the values or do you have the data in Json-Format etc.?

      Comment

      Working...