Besides the interface of Remote Facade pattern being more coarse-grained and clients calling this interface being remote rather than local, are there any other differences between the two patterns?
Thank you
Besides the interface of Remote Facade pattern being more coarse-grained and clients calling this interface being remote rather than local, are there any other differences between the two patterns?
Thank you
Are you referring to a
Remoteinterface like Java's RMI? I don't think that is afacadebut actually aproxypattern implementation.the Remote forwards all calls (hidden from the user via the proxy pattern) to a different machine. This hides from the user the fact that the work is not being done locally.
Facadepattern usually simplifies a complicated interface to a more simplified version (like a substituting a complicated control panel with a different control panel with only the a few of the most used buttons). If you really need the more complicated version, you can still use the old more complicated controls instead.EDIT After you pointed out that you are referring to Marin Fowler's
Remote FacadeI will explain further:Fowler's
Remote Facadeis not justRemote+Facadepatterns. There is also a extra reasoning behind the simplifications the facade uses.Instead of just simplifying complicated methods or removing under used methods from the facade.
RemoteFacadeis explicitly used to combine several common methods in the "unfacaded" interface to reduce latency and network traffic.Since
Remotecalls will go over the network (using Java's RMI etc) there is a lot of overhead to convert the method call into a message to pass over the network. It takes time for the message to go over the network and get a message back and unmarshal the response etc. There might also be security layers checking and intercepting the traffic as well. All add to the amount of time and effort to call the remote method.RemoteFacadecombines several common methods into a single network message. So using Fowler's example from his book, if you have an interface for Address with separate setters for setCity() setZipcode(), setStreet(). That would be 3 remote calls to go over the network. InsteadRemoteFacadeturns that into 1 method setAddress(street, city, zip) which will only require 1 networked message passed and therefore it should take less time to invoke.