Search your topic in Java2share
Home > SCWCD > SCWCD Question Bank
eXTReMe Tracker


11. Java EE Patterns (SCWCD)

Objectives
1.Given a scenario description with a list of issues, select a pattern that would solve the issues. The list of patterns you must know are: Intercepting Filter, Model-View-Controller, Front Controller, Service Locator, Business Delegate, and Transfer Object.
2. Match design patterns with statements describing potential benefits that accrue from the use of the pattern, for any of the following patterns: Intercepting Filter, Model-View-Controller, Front Controller, Service Locator, Business Delegate, and Transfer Object.

 

Q1. 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

Q2. A developer is designing a web application that must verify for each request:The originating request is from a trusted network.
The client has a valid session.
The client has been authenticated.

Which design pattern provides a solution in this situation?

A. Transfer Object
B. Session Facade
C. Intercepting Filter
D. Template Method
E. Model-View-Controller

Answer: C


Q3. The Squeaky Bean company has decided to port their web application to a new J2EE 1.4 container. While reviewing the application, a developer realizes that in multiple places within the current application, nearly duplicate code exists that finds enterprise beans. Which pattern should be used to eliminate this duplicate code?

A. Transfer Object                                           B. Front Controller
C. Service Locator                                           D. Intercepting Filter
E. Business Delegate                                         F. Model-View-Controller

Answer: C

Q4. Which two are characteristics of the Transfer Object design pattern? (Choose two.)

A. It reduces network traffic by collapsing multiple remote requests into one.
B. It increases the complexity of the remote interface by removing coarse-grained methods.
C. It increases the complexity of the design due to remote synchronization and version control issues.
D. It increases network performance introducing multiple fine-grained remote requests which return very small amounts of data.

Answer: A, C