This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

User Session - Servlet or SFSB

 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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.
 
J J Wright
Ranch Hand
Posts: 254
 
ShreeRam Manivannan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Thanks Jonathan Aotearoa for making it clear.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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.
 
Lann Lu
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • 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
 
Phil Haigh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Exactly.

Phil has the points.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic