• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Enthuware mock test - regarding

 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is from one of the Enthuware mock tests


Which of the following design patterns is normally used to reduce the number of remote calls made by the clients to the server?
Business Delegate
Model View Controller
Facade
Factory
Value Objects



The answer given is Value Object. Why not Facade - doesn't a Facade reduce the number of method calls ?
 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Subramaniam

A session facade is a pattern whose main function is to shield the client
from teh complex business processing which might be remote or local

Thus it serves as another layer of abstraction .

For eg A session bean (EJB) is an example of session facade

It explicitly does not reduce traffic because the client still makes
only one remote call , to the session facade but the complexity is
reduced since the session facade exposes the simple interface to the business processing to the external client .

So it simplifies things for client not necessarily reducing the traffic

However coupled with VOs they can result in reduction of traffic.
FOr eg a session beans method's input paramters can be VOs

Catch You Later
Shiva
 
PNS Subramanian
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shiva,

Agreed with what you have said about Facade. When you consider a work flow like system(a facade calling mulitple EJB's) would not the Session Facade be reducing the number of network calls i.e network traffic ? If a session facade is not available won't the client have to make multiple method calls to the EJB tier to accomplish the same task ?

I've come across in Wrox J2EE programming(Volume II) that reducing the network traffic/number of calls is one of the advantages of Facade pattern.
 
shiva viswanathan
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes , thats partially true .

But the main reason for using session facade to provide network
transparency .

If we are required to choose between VO and facade then
defintely Vo more fits the role of resucing network traffic

And i guess the qs says "normally"
and when designing a session facade reducing network traffic is not the main goal

Its just one of those ambiguous qs where we have to go for the best answer
i guess .
Thankfully number correct ans will be speciifed in the exam

Catch You Later
Shiva
 
author
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is not a great answer to your question... but as Facade is not on the syllabus, it ought not to be a correct answer to a "fair" question for the SCWCD. This is regardless of what the qualities of the Facade pattern might be.
 
PNS Subramanian
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A similar one


_________ pattern provides a layer between clients and subsystems of a complex system; shields clients from subsystem components, making the subsystems easier to use
Singleton
Facade
Business Delegate
Template Method



Can anyone take a shot at this one ? Would the exam have such questions ?

My answer was Business Delegate while the answer given is Facade !!!
http://java.about.com/gi/dynamic/offsite.htm?zi=1/XJ&sdn=java&zu=http%3A%2F%2Fwww.podar.net%2Fscwcd%2Fstartexam.htm
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic