Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger
  • Frits Walraven

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

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:

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!
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.


Pawel Piwowar
Dmitri Ericsson
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The URL previsouly mentioned


has been changed to

Client Stub Proxy Pattern

The following page contains a series of images describing the EJB Proxy pattern.
EJB Proxy Pattern
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
    Bookmark Topic Watch Topic
  • New Topic