Saturday 17 December 2011

SCWCD Questions 201 - 210


QUESTION NO: 201


Which statement is true about web container session management?
A. Access to session-scoped attributes is guaranteed to be thread-safe by the web container.
B. To activate URL rewriting, the developer must use the HttpServletResponse.setURLRewriting
method.
C. If the web application uses HTTPS, then the web container may use the data on the HTTPS
request stream to identify the client.
D. The JSESSIONID cookie is stored permanently on the client so that a user may return to the
web application and the web container will rejoin that session.

Answer: C


QUESTION NO: 202


You are designing an n-tier Java EE application. You have already decided that some of your
JSPs will need to get data from a Customer entity bean. You are trying to decide whether to use a
Customer stub object or a Transfer Object. Which two statements are true? (Choose two.)
A. The stub will increase network traffic.
B. The Transfer Object will decrease data staleness.
C. The stub will increase the logic necessary in the JSPs.
D. In both cases, the JSPs can use EL expressions to get data.
E. Only the Transfer Object will need to use a Business Delegate.
F. Using the stub approach allows you to design the application without using a Service Locator.

Answer: A,D

QUESTION NO: 203


Which two are characteristics of the Intercepting Filter pattern? (Choose two.)
A. It provides centralized request handling for incoming requests.
B. It forces resource authentication to be distributed across web components.
C. It reduces coupling between presentation-tier clients and underlying business services.
D. It can be added and removed unobtrusively, without requiring changes to existing code.
E. It allows preprocessing and postprocessing on the incoming requests and outgoing responses.

Answer: D,E


QUESTION NO: 204


A developer has created a web application that includes a servlet for each use case in the
application. These servlets have become rather difficult to maintain because the request
processing methods have become very large. There is also common processing code in many
servlets because these use cases are very similar. Which two design patterns can be used
together to refactor and simplify this web application? (Choose two.)
A. Proxy
B. View Helper
C. Front Controller
D. Session Facade
E. Business Delegate
F. Model-View-Controller

Answer: C,F


QUESTION NO: 205


A developer is designing a multi-tier web application and discovers a need to hide the details of
establishing and maintaining remote communications from the client. In addition, the application
needs to find, in a transparent manner, the heterogeneous business components used to service
the client's requests. Which design patterns, working together, address these issues?
A. Business Delegate and Transfer Object
B. Business Delegate and Service Locator
C. Front Controller and Business Delegate
D. Intercepting Filter and Transfer Object
E. Model-View-Controller and Intercepting Filter

Answer: B


QUESTION NO: 206


A developer is designing a web application that must support multiple interfaces, including:
an XML web service for B2B
HTML for web-based clients
WML for wireless customers
Which design pattern provides a solution for this problem?
A. Session Facade
B. Business Delegate
C. Data Access Object
D. Model-View-Controller
E. Chain of Responsibility

Answer: D


QUESTION NO: 207


A developer is designing a web application which extensively uses EJBs and JMS. The developer
finds that there is a lot of duplicated code to build the JNDI contexts to access the beans and
queues. Further, because of the complexity, there are numerous errors in the code. Which J2EE
design pattern provides a solution for this problem?
A. Command
B. Transfer Object
C. Service Locator
D. Session Facade
E. Business Delegate
F. Data Access Object

Answer: C

QUESTION NO: 208



A developer is designing a web application that must support multiple interfaces, including:
an XML web service for B2B
HTML for web-based clients
WML for wireless customers
Which design pattern provides a solution for this problem?
A. Session Facade
B. Business Delegate
C. Data Access Object
D. Model-View-Controller
E. Chain of Responsibility

Answer: D


QUESTION NO: 209


Which two are characteristics of the Front Controller pattern? (Choose two.)
A. It simplifies remote interfaces to distributed objects.
B. It promotes cleaner application partitioning and encourages reuse.
C. It provides an initial point of contact for handling all related requests.
D. It reduces maintainability due to the increased complexity of the design.
E. It provides loosely coupled handlers that can be combined in various permutations.

Answer: B,C


QUESTION NO: 210


Squeaky Beans Inc. hired an outside consultant to develop their web application. To finish the job
quickly, the consultant created several dozen JSP pages that directly communicate with the
database. The Squeaky business team has since purchased a set of business objects to model
their system, and the Squeaky developer charged with maintaining the web application must now
refactor all the JSPs to work with the new system. Which pattern can the developer use to solve
this problem?
A. Transfer Object
B. Service Locator
C. Intercepting Filter
D. Business Delegate

Answer: D

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...