Which of the following design patterns is normally used to reduce the number of remote calls made by the clients to the server?
Model View Controller
The answer given is Value Object. Why not Facade - doesn't a Facade reduce the number of method calls ?
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
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.
But the main reason for using session facade to provide network
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
_________ pattern provides a layer between clients and subsystems of a complex system; shields clients from subsystem components, making the subsystems easier to use
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 !!!