• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I have one about design pattern

 
swapnil vedpathak
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am solving one mock test ...but i think anwer given by them is wrong.. so please help me to correct this answer..

problem is like this


A wev developer is designing multi-tier application and discovers a need

to log each incoming client request. Which two pattern take independently

sove this problem..

(Select Any Two)
options--

A>Transfer Object

B> Service Locator

C> Front Controller

D>Intercepting Filter

E> Business Delegete

F>MVC


I think answer is - C, D is it correct answer?
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct! Both patterns *Centralize control* and are the most likely classes to touch every incoming request.

Good job!
 
dolly shah
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Business Delegate also touch every incoming requests. Isn't it? Correct me if I am wrong.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by dolly shah:
Business Delegate also touch every incoming requests. Isn't it? Correct me if I am wrong.

If you ran a hip electronics store and wanted to count how many people walk in and out you'd put your counting devices close to the door. Even though you know most people go to the cash register, the cash registers are not the best place to put counting devices because not every person makes a purchase and some people might go to the registers more than once. Even worse, there are often multiple cash registers and even different kinds, so you'd need multiple counting devices, which makes your counting more difficult to maintain.

The same is true for this concept in web apps. There is typically one Front Controller and it's very close to the door. A filter can be configured to handle all requests and is even closer to the door than a Front Controller. The Business Delegate is like the cash register: it's not close to the door, isn't guaranteed to catch every request exactly once, and could be more difficult to maintain if there are more than one of them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic