Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    caching considerations

    Hi,

    In my app, I have several databound components that use a common datasource, plus several custom components which work based on the same data.

    For various reasons, I have to load all the data to the client when the app starts (or at least when it's first needed).

    Furthermore, some listGrids can do filtering, but when this happens,
    - I do not want to "forget" the data that gets filtered out, and
    - the other components should not be influenced by the criteria.

    Furthermore, this data is dynamic; some of the databound components can make modifications, and when this happens,
    - the data should be sent back the server side, as usual
    - all components should see the modified data.

    * * *

    What would be the optimal data catching/storage approach here?

    (Should I use a ResultSet? Multiple ResultSets Something else?)

    Thank you for your help!

    #2
    We actually have an upcoming mode DataSource.cacheAllData which would be ideal for this - it loads all the data into a DataSource and can provide different subsets of it for different components (via ResultSets).

    The best way to implement this for now is to build DataSources normally, then use getClientOnlyDataSource() to obtain a second DataSource with a complete cache of all data, and bind that second DataSource to components. By creating a ResultSet on this second DataSource and registering for DataChanged notifications, you'll know when to submit modification operations ("update", "add", etc) against the original DataSources.

    Comment


      #3
      Thank you for your explanation.

      Btw, what do you mean by "upcoming'?
      (Any ETA when will it be usable?)

      Comment


        #4
        We haven't set an ETA. There's always sponsorship.

        Comment


          #5
          Originally posted by Isomorphic
          The best way to implement this for now is to build DataSources normally, then use getClientOnlyDataSource() to obtain a second DataSource with a complete cache of all data...
          Exactly where do I find this getClientOnlyDataSource() method?

          I have checked latest nightly build, but this method does not seem to exist on DataSource. (Or anywhere else in the JavaDoc.)

          UPDATE: now I see that it exists in the DataBIndings JS file, but the Java wrapper is missing. I started a new thread about this here: http://forums.smartclient.com/showthread.php?t=9992
          Last edited by csillag; 2 Mar 2010, 03:27.

          Comment

          Working...
          X