Question from a mock test on Application of J2EE technology
veena madhukar
Greenhorn
Joined: Jan 19, 2006
Posts: 29
posted
0
You are the chief architect of ABCD consulting Inc. and got a client green hound inc. to design an online bus ticket booking application. Currently your plan to have a controller to maintain user sessions, a customer component to hold personal details, a credit card validation component, a set of GUI screens and a Bus component with details of all routes and seating capacities. Which of the following should be used for each component?
I am not clear what the Controller should be? Should it be a Servlet or Stateful Session Bean?
Ricardo Ferreira
Ranch Hand
Joined: Feb 13, 2006
Posts: 156
posted
0
Originally posted by veena madhukar: You are the chief architect of ABCD consulting Inc. and got a client green hound inc. to design an online bus ticket booking application. Currently your plan to have a controller to maintain user sessions, a customer component to hold personal details, a credit card validation component, a set of GUI screens and a Bus component with details of all routes and seating capacities. Which of the following should be used for each component?
I am not clear what the Controller should be? Should it be a Servlet or Stateful Session Bean?
I dont know if this is a Whizlabs question or not but, two things needs to be considered over here.
1. Whether any workflow operations are involved or not. 2. The number of users using the application.
If there are workflow operations (like shopping cart) and the number of users are high go for SFSB , else go for servlet.
In this questions none of these factors are mentioned..so I think that servlet should be the answer.
B.Sathish
Ranch Hand
Joined: Aug 18, 2005
Posts: 372
posted
0
maintain user sessions - HTTPSession using servlets. a customer component to hold personal details - a CMP entity bean a credit card validation component - a stateful session bean talking to customer entity bean a set of GUI screens - JSPs a Bus component with details of all routes and seating capacities - a stateless session bean talking to a CMP entity bean for the database table that will hold the details of routes and seating capacities
You need a stateful session bean for the credit card validation component bcos the user may book several tickets for several routes and finally give the credit card number and check out. Hence the credit card validating component has to remember all those selections, validate the card number and bill him for all those selections. Hence you need to maintain conversational state across method calls. This is just like an online shopping scenario. Also, you would need to manage transactions in this application. Hence CMP is a natural choice. The last case, you need only a stateless session bean bcos there is no need to maintain any conversational state.
Panindrakumar Balellugari
Greenhorn
Joined: Sep 07, 2004
Posts: 14
posted
0
Controller should be a servlet. Key to note is that if SFSB is a controller then there will be a controller created for each user. But in reality a job of a controller is to control flow of the request and responses, which is generic to the entire application. Hence servlet as the Controller is the right choice.
I hope this helps.
Thanks, Panindra
Anderson Fonseca
Ranch Hand
Joined: Feb 05, 2004
Posts: 126
posted
0
If my GUI is swing based, i�d use SFSB or Servlet for my web gui.