• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

User Session - Servlet or SFSB

 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For maintaining user sessions in a web app. which one is best from an 'exam' point of view?
Servlets or Stateful Session Beans?


Ranga.
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
check out http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/web-tier/web-tier5.html#1083750
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI, Any stright forward answers for this question?.
 
J J Wright
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought the Blueprints were pretty straight-forward!

4.4.7.3 Web-Tier State Recommendations

When using enterprise beans, it's best to maintain session state with stateful session beans in the EJB tier. For Web-only applications, maintain the state in the Web tier as session attributes (using HttpSession).
 
ShreeRam Manivannan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jonathan Aotearoa for making it clear.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well...thats where the confusion is...in some of the mock exams, it was quite clear Enterprise Beans was going to be used. But for some reason, Servlets were preferred to maintain the user sessions. It was not completely clear why...


Thanks for your replies,
Ranga.
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There was one project, we didn't have users session data in memory at all. We persist session data to database, and the outcome is "surprisingly" good in terms of performance and simplicity.

Upon each click, application goes to database to retrieve the session data. This also makes clustering simple.

Most vendors support persisting http session to database automatically, but this explicit approach is quite different though.

Of course there are many downsides of approach, it may work for a narrow business domain.


Peace,
Tao
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by ShreeRam Manivannan:
HI, Any stright forward answers for this question?.



ShreeRam,

The straight answer is that you as architect decide which approach you are going to use, and justify that choice.

There may be a particular requirement that means you are driven to select one apporach over the other. If there isn't then you should be looking to justify your choice in terms of non-functional requirements.

None of the assignments have a single solution that you are expected to 'find', the examiners are looking for 'appropriate' choices and reasoned technical argument (expressed through your assumptions and design decisions) to back up those choices.

This applies to all the choices you make during the assignment - either there is a constraint within the information you are given that guides you down a route (stateless versus stateful, container managed persistence versus bean, etc) or there is not. When there is not you are expected to make an 'appropriate choice' and justify it in terms of the JEE architecture.

That is, after all, at the core of being a software architect.
 
Lann Lu
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exactly.

Phil has the points.
 
reply
    Bookmark Topic Watch Topic
  • New Topic