This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Java in General and the fly likes Java Facades, what's the point in them? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java Facades, what Watch "Java Facades, what New topic

Java Facades, what's the point in them?

Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
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
Ranch Hand

Joined: May 31, 2007
Posts: 3359
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

[] | [Java job hunting know how] | [Java resumes]
Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
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:
subject: Java Facades, what's the point in them?
It's not a secret anymore!