Login Register

Roles of DojoData model and store, now and in future?

A month ago we were speculating about the roles of the model and the store. The model seems somewhat redundant when used with a store. Since there's no definite answer and improving grid integration with dojo.data was already mentioned in grid priorities I'd like to ask for some clarification of their current/future roles.

For an example of the current situation, here's an generalized outline of the different approaches taken in two stores, namely dojox.data.QueryReadStore and dojo.data.ItemFileReadStore. What is depicted here is the state of some grid components after the grid has been scrolled down onto the fourth page and then back to the third page. The whole data set (5 pages) is stored in the backend and the grid viewport can fit one page at a time. ItemFileReadStore fetches the whole data set when it's initialized, whereas QueryReadStore fetches data page by page and doesn't even store a copy of the data. While the stores behave totally differently, there's no difference in the model or in the grid rendering cache. The model caches all the items and the rendering cache stores defined amount (by default 75) of row DOM nodes.

Grid      Grid             Model     Store       Backend
Viewport  Rendering Cache  DojoData  ItemFile        
                           1         1           1
          2                2         2           2
3         3                3         3           3
          4                4         4           4
                                     5           5


Grid      Grid             Model     Store       Backend
Viewport  Rendering Cache  DojoData  QueryRead        
                           1                     1
          2                2                     2
3         3                3                     3
          4                4         4           4
                                                 5

There are several interesting questions to be answered: What are the implications of these designs and how do they affect the performance? (see discussion about grid caching) How about customizing these data provider components (stores in particular)? (See extending QueryReadStore.) What does it take to get rid of the model? (See grid priorities - Improve integration with dojo.data)