Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Dmitri Ericsson
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Pawel Piwowar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dmitri Ericsson
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic