aspose file tools
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Session Facade, Business Delegate, Client Stub Proxy or simple services in integration Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Architect Certification (SCEA/OCMJEA)
Reply Bookmark "Session Facade, Business Delegate, Client Stub Proxy or simple services in integration" Watch "Session Facade, Business Delegate, Client Stub Proxy or simple services in integration" New topic
Author

Session Facade, Business Delegate, Client Stub Proxy or simple services in integration

Dmitri Ericsson
Ranch Hand

Joined: Feb 16, 2010
Posts: 109
Hi, ranchers,

I am completing my SCEA5 assignment and the more I polish it the more I have doubts in selecting or not selecting Facade patterns.

I have 2 external systems, one of them is accessed via web services, other is via plain sockets.
I have 2 corresponding stateless EJBs which provide a usable interface and encapsulate connection establishing process to those systems.

The main question is: Are those classes Session Facades or just typical business services?

From the description of the Session Facade pattern I understood that this pattern is used when you have a system and you expose its functionality via session facade to another external system. But in my case I have a client system which uses other systems functionality (via sockets or web services), so this class is consumer, and facade seems to be always a provider.

I even thought that this can be a Business Delegate, the description of this pattern suits well, but I've read that this is more a view-tier pattern, however I invoke it from pure business logic.

Another possibility is that this is a Client Stub Proxy pattern, as described here: http://www.ewebprogrammer.com/ejb-architecture-session-beans/module2/client-stub-proxy-pattern.jsp

I try to put more-and-more patterns in my implementation... perhaps I should stop and just leave those classes as typical business services?

Glad to see your thoughts!


SCEA 5, SCJP 6 My SCEA Experience
Pawel Piwowar
Greenhorn

Joined: Feb 12, 2010
Posts: 21
Hello Dimitri,

Frankly speaking, I do not understand what are you trying to achieve ?
Trying to use as many patters as possible is not a good idea IMO. Patterns should only be used in case you have a problem that should be solved.
For example if you have many stateless session beans providing lot of services, you can use Session Facade in order to simplify the interface and reduce user calls.
In you project there is probably no need for such additional layer. Additionally your definition of Session Facade is not correct. You can't simply name any EJB a "Session Facade", only because it exposes services of external system.
If you want to find the name of the pattern you use, I think the closest one is "Proxy" (GOF , not Client Stub Proxy).
Each session bean acts as a proxy between clients and external system.

Regards,

Pawel Piwowar

SCJP 5, SCWCD 1.4, SCBCD 5, SCEA part1
Dmitri Ericsson
Ranch Hand

Joined: Feb 16, 2010
Posts: 109
Hi,
thanks for clarifying this issue
I've just done design as I've done in a real life but I was not sure what pattern describes this solution. Now it's clear
Br,
Dmitri
 
 
subject: Session Facade, Business Delegate, Client Stub Proxy or simple services in integration
 
Threads others viewed
SOAP with JSP
mock question: design pattern
Do we need to show BD & Service Locator in Sequence Diagrams?
Session Facade Vs business delegate
Business Delegate with JSPs
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com