views:

43

answers:

1

Hi,

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 AJAX 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.

A: 

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.

It Grunt
I don't understand your "the whole point of a web app is to have your loginc on the server-side". If you have a web based Photoshop, why would it be necessary to have server-side business logic?
rFactor
The server-side business logic for the photoshop example would be for the uploaded images to be associated with your login account. The photo manipulation tools use a client side framework (FLEX) to interact with the back end.For your login example, I really think any MVC (Model View Container) framework will provide what you're looking for.
It Grunt