AJAX Made Easy - Learn AJAX



Frameworks Tutorials

 
Home Frameworks
 

OfflineRest From Dojo

 

One of the biggest challenges for developers of an Ajax based application is to come up with an online application with offline functionality. It is a well sought out application by users and developers alike as this would provide users the chance to work offline.


Developers on the other hand will be reaching out more users as their applications will be available without any constant internet connection. This application would be automatically updated when it connects online without even disrupting the application. This type of application will hopefully increase productivity and continue the user interaction even when offline.


Developers need an application that could cache the activities and information online, storing it in local computer so that it interacts with the user later. This is very challenging since it will require developers to build a highly complicated application and it will require a powerful computer with strong internet connection. Without these prerequisites, an offline version of an Ajax based application cannot function well.


Dojo has apparently created an answer to that need. This very popular framework created a module called dojox.rpc.OfflineRest which will enable developers build an application with full offline functionality. With the help of JSON, developers should be able to upload the information to the local computer faster.


This could be done through additional functionality called Rest Services. This type of service receives the information from the server and transmits them to local storage. This will be faster because the application has already been installed and smaller amount of data is needed for proper updating.


The difference of the offline functionality of OfflineRest to local applications is the JsonRestStore. Instead of launching data directly to the application, it will use JsonRestStore to temporarily cache data within the application. Through JsonRestStore, the application will be streamed with updated information.


This module is used by Dojo so that applications could be updated while being online without disrupting the application. The communication between server and Rest Services is controlled. Rest Services to OfflineRest or local storage is also controlled so that it will not disrupt the application.


Reconnecting online would mean the old and new information will be streamed. The “screeners” before JsonRestStore will ensure that the application will only receive new data instead of repeatedly receiving updates that are already stored in the local storage.


The application could be easily built from the developer’s side. However, there are certain prerequisites that the local computer would do. When the application is first launched locally, it will look for Google Gears first as the platform for launching the mobile. If Gears is not available, it will resort to HTML 5 as the platform which means it could be a lot slower but would still as effective.


The slowdown is caused by HTML5 since HTML 5 is not as robust compared to Gears in dealing with JSON and JavaScript. If HTML 5 and Gears is not available, OfflineRest from Dojo will seek out the local Flash as its platform in establishing a highly effective offline interaction.



Read Next: Introducing GwtPHP



 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links