Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mock exam question related to design pattern

 
pradeep singh
Ranch Hand
Posts: 339
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
69
Marks: 1
Which design pattern does the following description most closely match?
"This pattern is designed to have an object that knows how to get hold of all of the services that an application might need. It is designed to minimise network traffic and improve communication effeciency. It is often used in conjunction with the Business Delegate pattern"

Choose one answer.

a. Model View Controller


b. Transfer Object


c. Business Delegate


d. Service Locator


e. Facade


Answer is given d.But i think it should be b because it is mentioned in Peabody's notes that Transfer Object reduces Network traffic.
Please Correct me if i am wrong.


Source: Marcus 2 exam
 
Musab Al-Rawi
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Transfer object reduces network traffic but doesn't knows how to get hold of all of the services that an application might need.
 
Salil Dhawan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya i think answer is Transfer Object.Definitely not Service Locator
 
Javier Snaider
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer d is correct both patterns reduce network traffic but the pattern descrived is Service Locator

Javier Snaider

SCWCD 5
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question's clues are:
1) It gets service objects
2) Reduces network traffic (by caching service objects, by the way)
3) Paired with Business Delegate

Clues 1 and 3 are dead giveaways for Service Locator. Clue 2 is most likely to describe a Transfer Object, but clues 1 and 3 don't make sense for Transfer Object at all.

I really recommend using my notes as a supplement to your patterns studies. My notes don't really explain the patterns in detail - you should learn that from a book or from the core patterns website (link can be found in my notes).
 
pradeep singh
Ranch Hand
Posts: 339
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankx to you all specially Marc Peabody to clearify me.
 
Olivier Ledru
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both reduce Network traffic, but not the same way.
Transfert Object reduce it by sending a bundle of data in one remote call, instead of having several small remote call.
Service Locator reduce it by "caching" high-cost resource (like JNDI resource).

The answer is definitely Service Locator to me.
[ June 06, 2008: Message edited by: Olivier Ledru ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic