PDA

View Full Version : How to support multiple data sources like AJAX and AIR SQLite



Nalfein
3 Jun 2009, 4:27 AM
Hi everybody,

I am writing an Ext JS application which will consist of two versions: the web version and a desktop program created using Adobe AIR. I would like to be able to switch the default data source used by the application so that certain AJAX calls are replaced with SQLite calls. Another thing is handling connection issues in AJAX calls. I would like to be able to resend requests on failure, authenticate again if session expires etc.

My question is how to implement that data layer so that I can make all Ext JS components use it. I was thinking about providing two implementations of Ext.data.Connection or Ext.direct.Provider. I don't understand the concept of Ext.Direct very well yet, anyway my back-end server has a clean REST interface and I wouldn't like to turn it into RPC.

What is the preferred approach?

Thanks,
Adam Dziendziel