Your company requires all its developers to use a well-specified set of exception classes to model several common error conditions, many of the which are specific to its business. These exception classes are centrally maintained and come packaged in a library (a JAR file). The application you are developing needs to report a number of error conditions covered by this library to remote clients.
Which paring of component type and remote access technology enables client applications to use the predefined exceptions as part of their natural programming model?
Servlet accessed using HTTP
Entity bean accessed using web services
Stateless session bean accessed using Remote Method Invocation (RMI)
Message-driven bean accessed using Java Message Service (JMS) queue
Correct answer: C
Explanation:
correct answer.
correct answer.
Question 2
While analyzing an existing web application, you observe the following issues in the source code:
Duplicate control code is scattered throughout various view.
Business and presentation logic are mixed within these view.
The next phase of the project involves refactoring the existing code to address these two issues.
Which design pattern, if employed in the refactoring exercise, would most directly address the two issues?
Service to Worker
Dispatcher view
DAO
Composite View
Correct answer: A
Explanation:
Reference: http://www.vincehuston.org/j2ee/corepatterns.html (see `service to worker')
Reference: http://www.vincehuston.org/j2ee/corepatterns.html (see `service to worker')
Question 3
You are using an open source integration framework in your project. However, key interfaces do not explicitly define several strange conditions you have repeatedly seen while testing.
Which option is the name given to the anti pattern described above?
Composite View
Leaky Abstraction
Asynchronous Interaction
Golden Hammer
Correct answer: B
Explanation:
All non-trivial abstractions, to some degree, are leaky. An abstraction that works most of the time, but where a detail of the underlying complexity cannot be ignored, thus leaking complexity out of the abstraction back into the software that uses the abstraction.
All non-trivial abstractions, to some degree, are leaky. An abstraction that works most of the time, but where a detail of the underlying complexity cannot be ignored, thus leaking complexity out of the abstraction back into the software that uses the abstraction.