Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Facades, what's the point in them?

 
Kevin P Smith
Ranch Hand
Posts: 362
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
arulk pillai
Author
Ranch Hand
Posts: 3380
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Kevin P Smith
Ranch Hand
Posts: 362
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic