File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Single or multiple facades" Watch "Single or multiple facades" New topic

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:
subject: Single or multiple facades
It's not a secret anymore!