While I always thought of Cayenne zero-effort ability to store state
in memory between requests as a great feature, in a normal web
application I avoided using it when possible, cause you need to be
extra careful about back button issues and such if you have some
uncommitted session state.
Now I started to get involved in more frontend development, naturally
using JavaScript and asynchronous communication with the server.
That's where this feature shines. A user can spend significant time on
a single page, loading and storing data from various UI elements via
AJAX, using a session ObjectContext to maintain in-memory object
graph. After (s)he is satisfied with results, the user clicks "Save"
button once, the graph is saved to the database. This way there's no
need to keep the entire graph on the client, client code can save
changes incrementally in response to the user actions, avoiding
sending large chunks of XML across the wire. Nice and clean...
Now I guess using a nested DataContext is still a good idea in this
situation for the same reason as a regular web app - back button,
reload, multiple windows, etc...
Andrus
This archive was generated by hypermail 2.0.0 : Tue Nov 27 2007 - 09:28:46 EST