This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
just wondering if you guys couldd clear this question up for me?
Been looking round and it seems they're meant to be the way to go if you have a system that makes a number of calls to Beans causing network lag.
Point 1: How do they improve system performance?
Point 2: What do they actually do? I've had a look around and can;t really find any decent examples (all theexamples I've found don't work). Froim what I can see all that's different between Facades and standard Interfaces is that a Facade calls Methods from several different Beans rather than 'one Interface to one Class'...
Is this right? I'm guessing it reduces network lag, bacause you only have one Interface call rather than several.
Facades can improve performance by making coarse grained calls. For example a client can make one coarse grained inter process communication (i.e. from one JVM to another e.g Web Service call etc) whereas the facade will make a number of fine-grained calls to the local components (i.e. within the same JVM). This minimises the number of network calls.
Secondly a facade minimises the complexity in interactions between the caller and the callee. Look at the Java facade design pattern
Don't suppose you have a simple example (I work better with examples), I've scanned the Internet for a day now and believe it or not I can not find a single decent WORKING example. The only two examples i found were riddled with erros tht made no sense (one even seemed to ever actually call the Interface!!! Quality)