I have always advocated the stateless web, but would like to know what the advocates of the stateful web are saying.
Do you have any situation where stateful is more appropriate than stateless?
I have always advocated the stateless web, but would like to know what the advocates of the stateful web are saying.
Do you have any situation where stateful is more appropriate than stateless?
Using states generally makes the programmers job easier.
However, states also introduce all sorts of concurrency issues that are simply not present in stateless situations.
This is essentially the debate between functional and imperative programming.
Things like long forms (and really anything that takes more than one page refresh) are much easier with persistent state, since you can actually keep track of what page/stage the user is on in an easy and straight-forward way. However, I personally don't think such a small advantage is worth it, but it greatly depends on the web application in question.
Our project uses the Wicket web framework, which allows stateful or stateless interaction. Stateful pages have a number of advantages:
Anything that's possible in a stateful application could also be implemented as stateless - you simply have to store the state on the client, and submit all relevant state information on every request.
Link to wicket: http://wicket.apache.org/
I'm in the statefull client-stateless server camp due to scaleability but when facing the hurdles of explaining why this and that became harder to implement using a stateless server, you get kind of resigned in the long run, this is where stateful server shines:). Eventhough I prefer statefull client this is not easy to implement efficiently using asp.net viewstate and perhaps this is where statefull web gets practical. I think statefull client, stateless server makes you more aware of the amount of data that is transported back and forth between tires. That is sometimes hidden until trouble occures using statefull server programming model. Also, going from stateless to statefull is easy (just ignore state info that you are providing since you already know it.. ). Going the opposite is almost impossible/not worth it. Another thing using a statefull server is that clearing state/cache is often a problem when you are using also a statefull client. It's just unintuitive and confusing, or maby just I am :)
Anyhow GWT and many other modern toolkits (Silverlight talking to WCF) seems to prefer stateful client, stateless server due to scaleability issues. Maybe stateful server should be the exception to the stateless rule ... one could choose per page/window.