Object Persistence - Ajax Patterns

Object Persistence

From Ajax Patterns

Revision as of 00:42, 10 February 2007; view current revision
←Older revision | Newer revision→

Evidence: 1/3

Tags: Object Persistence


In A Blink

Object persistence has become an important part of many development projects because of the improved structure of coding that it provides. With object persistence, objects can be manipulated with normal programming techiques, and their state can be stored in persistent storage (on the server or client). In future sessions, the persisted objects can be restored to their previous state.


A JavaScript application stores all of it's state information in objects. Is there any way to persist this information without writing custom code to go through each object and store its state by making calls to server with the state information?


Standard object manipulation is a very natural programming technique. Persisting objects in other languages has already proven very powerful in improving code structure, for example in Java (JDO implemented through Hibernate, JPOX, etc), and simplifying the job of storing state information.


Utilize a general object persistence strategy where JavaScript objects can be manipulated and their state information can be persistently stored. In future sessions, the persisted objects can be restored to their previous state. This often provides a more natural programming experience instead of forcing programmers to develop their own techniques for saving the state of their applications.


When to persist the object data?

Objects can be explicitly loaded and saved. Or you can use a class of persistable objects that manage get and set calls, and the data can be persisted when these calls are made.

Where to persist the data

Object data can be stored on the server through remote calls, or it can stored locally using a local storage technique.

Real-World Examples/Frameworks


Authenteo is a framework that allows entire web applications to be developed with persisted objects that accessible and manipulated from client side JavaScript.


Ajaxdo is a framework to save and load objects to a server connected to an SQL database.

Dojo Storage

Code Examples