• 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

Question from a mock test on Application of J2EE technology

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If my GUI is swing based, i�d use SFSB or Servlet for my web gui.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic