[Dojo-interest] JSONRestStore lazyload design issue

Kris Zyp kris at sitepen.com
Sun Jul 19 09:33:18 EDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Yes, I agree, this is just another symptom of the same problem with
the Tree that I had mentioned earlier when explaining JRS+Tree
behavior. The TreeStoreModel needs to allow an alternate loading
scheme where each displayed is allowed to be a non-fully loaded item
(isItemLoaded returns false), and a node is loaded (via loadItem) when
it is expanded (but each of the children items are not loaded until
they are expanded). This would allow you to have nodes that when
expanded, JRS would request the full item with children (rather
providing the children (and their ids) before expansion). For example
when the root was expanded:
{id:"1", name:"Root", children:[{$ref:"2", name:"Child 1", children:
true}, {$ref:"3", name:"Child 2", children: false}]}
Thus children ids are only computed when needed.

Taking a look at TreeStoreModel.js, it looks like this would be really
easy to add an option to support this type of loading mechanism. I'll
put together a patch/ticket and see if we can get this available soon.

Kris

Jean-Rubin Leonard wrote:
> Hi all,
> I had noticed it but had not made a big case of it but there is an
> issue that was brought to my attention by Jochen Zimmermann
> <zet4080 at gmx.de>. He is having problems posting to the mailling list
> so I'm taking the ball and putting this issue for discussion to
> validate our shared concern.
>
> Right now the way the lazyloading of the store works is that a node
> presents itself with its information and if it has children it says
> (conceptually of course) here are my children they are named 1, 2 and
> 3 (children : {ref:1....}. While this works it is very expensive on
> the server. I had experienced it but Jochen is the one who formally
> explains it: If we have 100 root nodes with each a 100 children, we
> will have to load 10100 records from the database to create the
> structure.
>
> The approach that I had initially tried was to have the root nodes
> (and each subsequent parent) say: this is my information and (if they
> do) I have children and leave it at that. If we do so, only the 100
> root nodes would be loaded at first. Those with children would have
> the expando beside their name. We would know they have children but
> these children would be loaded if and only if we click on the expando.
> At which point we would get the child information and we repeat as
> needed. This would be a far less expensive way of getting the lazy
> load behavior and one we think we should move towards.
>
> Is there a ready made solution or should we request a feature in dojo?
> Do you guys see the sense in what we are saying?
> Thanks for feedback,
> JR
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest at mail.dojotoolkit.org
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>

- --
Kris Zyp
SitePen
(503) 806-1841
http://sitepen.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
iEYEARECAAYFAkpjIJ4ACgkQ9VpNnHc4zAwY/ACbB/Q3sE069Rs9NB6AE+L8onmg
uvgAn2CSRcrJ+kE+bTzG8kpfRNvXYQWL
=afEl
-----END PGP SIGNATURE-----



More information about the Dojo-interest mailing list