JavaScript based application work flow -- how does it work?
I often find myself wondering what is the best way to do a JavaScript based web application. The server may be PHP, Perl or whatever -- but when the client-side is ExtJS or something similar, how do you construct your application? What is the work flow exactly?
For example, how is the authentication handled? In a current application I am developing, I have an ExtJS viewport with a login screen component in it, when the app is being run, it does an AJ开发者_运维问答AX callback to the server to find out whether it's authenticated. If not, I show the login part -- else I show the application viewport. And then depending on the URI hash (e.g. #page=settings&subpage=ui) I run automatically certain components and events in my system.
And what do you do with the back-button. Currently I have a timer that checks if the hash has changed, and if so, I run the new action based on the new hash.
I am interested in any application work flow or logic that you have to share with me -- or any resources you got. I feel like JavaScript based application development has not matured enough yet, because there is almost zero blogs, tutorials, articles, whatsoever talking about this kind of stuff.
One option would be to leverage some of the capabilities of popular frameworks such as Spring MVC. Spring has the ability to handle workflows.
Spring Webflow Introduction
The whole point of a web application is to have your business logic happen on the server-side and not the client. JavaScript can be pesky enough to debug on it's own. Things that are business-logic heavy is best encapsulated in it's own tier of your application.
精彩评论