Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

another design pattern ambiguity

 
Parth Twari
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HF 1 st ed Final mock
67.
You are developing a web application for an organization that needs to display
the results of database searches to several different types of clients, including
browsers, PDAs, and kiosks. The application will have to examine the request
to determine which type of client has initiated it, and then dispatch the request
to the proper component.
Which J2EE design pattern is designed for this type of application?(choose 1)
A. Transfer Object
B. Service Locator
C. Model-View-Controller
D. Business Delegate
E. Intercepting Filter

Given: C
But i think it shall be E

See this part says its MVC
You are developing a web application for an organization that needs to display
the results of database searches to several different types of clients, including
browsers, PDAs, and kiosks.


And this part says its intercepting filter
The application will have to examine the request
to determine which type of client has initiated it, and then dispatch the request
to the proper component.

 
Rafael Leandro Santos
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Parth, I think C is correct because, browsers, PDAs and kiosks are different types of client interfaces, and MVC separates the application into different parts, this division allows code reuse of business rules enforcement, among them, web (browser), PDA, kiosks, swing, etc ... Already the intercept filter on my understanding, is a standard that seeks to intercept any request to execute routines for each request ... Seem to be very different ... I have helped.
 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want, have a look at
Intercepting Filter

and

Model View Controller (MVC)

You are right that there is overlap, but the emphasis of the two patterns is different.

The Intercepting Filter pattern is used better when providing services such as logging, security, etc.
requiring some pre-processing or post-processing. All without affecting the flow.
 
Parth Twari
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@rafael , I understand that this functionality
this division allows code reuse of business rules enforcement, among them, web (browser), PDA, kiosks, swing, etc .

is implemented by MVC only.

@Gian , @rafael

But guys see this functionality
The application will have to examine the request
to determine which type of client has initiated it, and then dispatch the request
to the proper component.


this can be applied only by Front Controller or Intercepting Filter , since FC is not in the options then don't we have to take into account IF?
If you think only MVC is the answer then how will it examine each request? in MVC each request goes to its specific servlet, there is no centralized hadling of request.

Ex: A client sent a request for /app/mybeer.do now this goes straight to the mybeer.do servlet , we had no time to find out that is it the PDA sending a request or a browser or mobile browser something. in this case we will have to put the client deciding logic in each servlet of webapp and then forward to different parts. Do you think that will be a feasible solution?


 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parth Twari wrote:
If you think only MVC is the answer then how will it examine each request? in MVC each request goes to its specific servlet, there is no centralized hadling of request.

Ex: A client sent a request for /app/mybeer.do now this goes straight to the mybeer.do servlet , we had no time to find out that is it the PDA sending a request or a browser or mobile browser something. in this case we will have to put the client deciding logic in each servlet of webapp and then forward to different parts. Do you think that will be a feasible solution?


Not necessarily...you can have a custom request processor that can bring into play some customisations.
 
Parth Twari
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm..

ok.. thanks...
 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Parth,

...if you want read the introduction to this article it
gave me some clues for where to look at for more
details...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic