PDA

View Full Version : [OPEN-1226] Ext.data.Store and Ext.data.DataReader code and documentation issues



timbonicus
20 Aug 2010, 3:13 PM
The DataReader class uses a 'meta' object instead of the standard ExtJS convention of a config object. The configuration options are not fully documented; DataReader references idProperty in the extractData function.

DataReader uses instanceof XmlReader/JsonReader in the extractData function that doesn't seem appropriate for an abstract parent class.

The ExtJS documentation for DataReader does not mention the read or readResponse methods that are used by HttpProxy when the Store data is read from a remote URL. This led to quite a bit of frustration and source code spelunking when attempting to create my own DataReader implementation and realizing that the documented functions are never called when loading data remotely.

This looks like a dark corner of the ExtJS code, so I wanted to shed some light on these issues while they were fresh in my mind. Thanks for the hard work producing a great library!

Condor
20 Aug 2010, 10:34 PM
These are known issues.

The fact that DataReader doesn't has a config object parameter in the constructor is for backward compatibility (can't be changed without breaking existing code).

The documentation for DataReader is indeed a bit sparse, but since DataReader is an abstract class that you won't instantiate, I don't see this as a big problem.

I completely agree about the instanceof. I would have made the property names configurable instead of hardcoding the descending classes.

In Ext 4 the complete data package will be rewritten and merged with Sencha Touch (which has the advantage that you can use a single server implementation and client side data configuration for both desktop and mobile development).