This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Single or multiple facades Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Single or multiple facades" Watch "Single or multiple facades" New topic
Author

Single or multiple facades

Ali Hussain
Ranch Hand

Joined: Jun 19, 2005
Posts: 211
Has anyone used a single session facade and passed the exam with good scores? Or do we have to have 2 (or even three in this case) facades?


- SCEA, SCJD, SCBCD, SCWCD, SCMAD, SCJP, ICAD (WebSphere), Lotus Principal CLP, Lotus CLP, Lotus CLS
Jeremy Hsu
Ranch Hand

Joined: Mar 28, 2005
Posts: 79
Well, it is all about grouping and easy of use.

When you create a session facade, you are trying to use one session bean to abstract interactions of several session beans / entity beans.

In other words, you will find that there are few interactions are very related in nature, and you probably want to make one session facade to include these. While you may need to create another session facade to address other related interactions.

One of the problem I find with poorly designed session facade is that they have one session facade and put everything in that.

You see methods like this getItemPrice, getShoppingCartCheckOutPrice, and getFinalizedBiddingPrice. The freaking long method name just annoy and it hurts code readibility. However, if you have 3 session facade, ItemService, ShoppingCartService, and BiddingService. Each of these session facade has one method called getPrice. In terms of usability, the latter approach is better.

Therefore, all comes down to complexity of your application. Sometimes, your system makes sense to be described using 1 session facade.

[ July 01, 2005: Message edited by: Jeremy Hsu ]
[ July 01, 2005: Message edited by: Jeremy Hsu ]
Ali Hussain
Ranch Hand

Joined: Jun 19, 2005
Posts: 211
Thanks a lot. I have already submitted my assignment and luckily made a decision that was somewhat similar to your ideas
Going to take part III on Monday.
[ July 02, 2005: Message edited by: Shahid Afridi ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Single or multiple facades