First of all, this is a scea regarding question? Otherwise, try to look for this answers at others forums. Considering that it is about scea assignment:
What are your motivations to store session at the client tier? This is absurd at jee applications because client tier does not scale at many redundant servers, and potentially you could loose your session at a application client trash. Keep session at the web or ejb tier remains clear because you could threat aspects of concurrency and transactions data of sessions.
"hoping all browser support AJAX"
This is not a valid architecture consideration. Architecture means create solid based applications using proof of concepts, robust analysis and design methods and mitigation of technical risks. Architecture are used at the elaboration phase to ensure that construction are going to be made without potential risks of failure, so 'hope' that the browser supports Ajax is not a good approach. For the scea assignment, this is the first thing that the corrector will see at your design and potentially reprove you.
Revise your non-functional requirements and verify valid considerations to use session data at the client tier. Just to keep the things clear. Ajax does not need to be used to maintain client state. At JSF programming model, we call this 'save-state' attribute, this is the same at ASP.NET programming model. Is just about a hidden field that store the serializable version of the page. This is a valid approach, but for transactional and concurrency features, this should be evicted.
Originally posted by Pham Huy Anh: Hello,
After reading through this forum, I see some members use HttpSession, some others use SFSB, some use back end database...
Me, I propose to store session information in clients tier. - AJAX for web, hoping all browser support AJAX. - some kind of static JavaSession in swing
Do you think it's OK? And do I have to support non-AJAX browser.
Thanks Marc Peabody and Ricardo Ferreira for anwsers.
I think I was explaining not very well. I did mean I don't use session management at server side, in my solution session's data is stored at clients side and will be submitted one time, HttpSession is just to keep connect between client and server, just customer id for example. I will explain in more details.
1. Normally, to complete a shopping card, user must pass many step: search, browse, view , select.... A lot of screen. All the informations during this session are usually store in server session: HttpSession, SFSB.
2. In my solution: using Ajax to store all the shopping card at client side. When check out, the browser send the whole ShopCart to server. So I don't need a big HttpSession (600 concurrent big session).
Do you think it's better for performance?
3. Nowadays, I think AJAX is the good trend which is supported by both Java and .Net. I see some sample web 2.0 app use AJAX. That's very good.
Yes, you are right, I should find a solution for non-AJAX browser. I will think again...