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

Question from a mock test on Application of J2EE technology

 
veena madhukar
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?


Use Servlet's without doubt!
 
Raghubir Bose
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 372
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If my GUI is swing based, i�d use SFSB or Servlet for my web gui.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic