Doubt on a web tier Question from Cade & Humphrey's Study Guide 2nd edition
Joined: Dec 13, 2009
Question is as follows:
XYZ Corp has retained you as the architect for their latest web app: XYZOnline. This app allows customers to search, browse, and order catalog content online. XYZOnlin access the inventory and payment system as web services. What architecture do you recommend?
A. JSP/JSF pages accessing the web service layer using stateless session beans.
B. Servlets accessing the web services directly using JAX-WS as necessary.
C. JSP/JSF pages accessing web services layer using JAX-WS as necessary.
D. JSP/JSF page accessing the web services using JMS.
Answer is C. I don't understand. JSP/JSF View should not have any business logic. If you want to fullfil inventory and payment operations, you need some business logic. Business logic should not be present in View, right? If you look Web service as presentation data model, you should use View helper like JSTL or Custome tags to adapt View to the data model, right?
I guess that C is selected because of JSF which can use backing bean or custome UI component to access web services. Do you aggree?
I selected B. But its explanation is that B uses Servlets to generate the presentation. Is it because B doesn't metioned Presentation solution?
Joined: Jul 27, 2001
Looking at the options available, I would have select C.
Because there is no mention of scale issue, so no point going for EJB's. so one option is out.
Servlets wont be used for presentation, so that option is also out.
JMS to access web service, i dont think.
So option which is left is C. Yes i agree there should not be any business logic in presentation tier, but using some beans in JSF, i think accessing web service will be idle solution by looking at the problem statement.