I'm working on a major new version of a browser based application and I'm looking for comments/suggestions about the architecture/design.
It's a single page application using AJAX and client side templating to get new "pages". I'm already using the Sammy Javascript library to handle bookmarking and forward/back buttons. I'm using JQuery, parts of JQueryUI, SlickGrid, and a little Dojo (mostly dojox/rpc/jsonrpc and it's dependencies) so far.
I'm communicating with the server using JSON RPC calls through a very thin web server layer that just forward the JSON strings to the business server, which has an API accessible in various ways, but the browser uses JSON RPC only. Session state tracking happens in the business layer as part of the implementation of that API, though of course the RPC mechanism must give enough information to identify which session is calling it.
All that was context; the question I have is: does anybody know of any resources supporting this kind of design? In particular I would be looking for open source Javascript libraries besides Sammy that support single page web applications. Sammy expects you to use client side templating, and has some support for that plus several plugins for particular templating libraries, but doesn't support similar functionality for using AJAX to apply CSS style sheets (and remove or deactivate others) when you change screens and would have changed pages in a more traditional web application.
I'd also love to hear from anyone who has tried something similar. Were you okay with one stylesheet for the whole application? Did you have issues with memory leak issues from staying on one page for so long?
Also, any suggestions for a client side design? Does MVP sound reasonable, with a model implemented in Javascript, presenter classes to implement events in an abstract way that's easier to unit test, and the view to handle the actual DOM stuff? Some sort of application manager to track what pages are up, and that would clean up resources when a screen closes?
I haven't seen a lot of comprehensive references or libraries for the single page design, so anything people can tell me or refer me to would be appreciated.
Note that I have read Dev approaches to complex JavaScript UI's, which is a great question but not specific to single page complex Javascript UIs.