[Dojo-interest] dojo.data ideas

Anthony Fryer apfryer at hotmail.com
Thu Apr 10 11:10:50 UTC 2008


Having worked with the dojo data store for a while now, I have some ideas that i'd like to suggest for consideration as future enhancements.
 
1/ Create a metadata api.  Currently the store has limited metadata functionality by way of the getAttributes method, which requires an item to have already been fetched.  A metadata api (ie. getMetaData ) would be useful because you can return more extensive metadata describing the attributes of the item.  For example, datatype (string, integer, date, etc.), length, precision, descriptive name, etc.  Some uses for a metadata are to create a structure for the dojox.grid and to create a form for editing an item.  The metadata can be retrieved without the need to fetch any items before hand.
 
2/ Add a count method to the read api and change the fetch onBegin callback to not pass the total count of items in the store.  The rational for this is that a count can in some circumstances take considerably longer than a fetch of data.  For example, if a table has 100,000 rows, fetching the first 20 rows could take < 1 seconds but performing the count could take much longer.  The fetch is then delayed until the count is completed.  If the count is separated from the fetch, then the first 20 rows could be rendered in the grid (or used for any other purpose) long before the count is returned.  This also means the fetch and count can be performed in parallel on the server-side.
_________________________________________________________________
Find the job of your dreams before someone else does
http://mycareer.com.au/?s_cid=596064 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://turtle.dojotoolkit.org/pipermail/dojo-interest/attachments/20080410/5be149df/attachment.html 


More information about the Dojo-interest mailing list