Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » J2EE Pattern »

Re: Business Delegate v/s Session Facade

Alok_Band

2003-09-06

Replies:

Hi Maciek,

Thank for reply. I am an early bird in J2EE patterns. Please clarify my
doubts.

    So what is business delegate about?
    - tt hides from a client all complexity connected with network
calls,
    i.e. a client invokes some method on a delegate which is a normal
java
    object, and delegate uses lookup services to find a target session
facade

Look up services are best addressed by "Service Locator" pattern. Service
Locator will contain code look up any services(like JNDI lookup and creation
of remote for session facade) so should one still use Business Delegate if
"Service Locator" is used?

    - it can catch "network" exceptions and show a client "business"
    exceptions so that a client e.g. does not have to know anything
about
    the service distribution

Consider MVC application, should not Servlet convert network exception in
user understandable message instead of adding one more layer. Even if
Business Delegate throws any "business (Application)" exception servlet
would still have to catch it and display it to user.

Thanks and Regards,
Alok



> -----Original Message-----
> From: Maciek Z.ywno [SMTP:milosc@(protected)]
> Sent: Friday, September 05, 2003 7:18 PM
> To:  J2EEPATTERNS-INTEREST@(protected)
> Subject:    Re: Business Delegate v/s Session Facade
>
> Alok_Band wrote:
>
> >I seek clarification about Business Delegate pattern.
> >
> >If business services is implemented as normal class then user must start
> >Transaction Explicitly. But then why should not one use Session Facade
> >pattern as container would take care of transaction boundaries.
> >
> >Can anybody please elaborate how Business Delegate is different then
> Session
> >Facade?
> >
> >
> One is not to decide whether to use either session facade or business
> delegate.
> Actually business delegate should be used with a session facade, usually
> in a mapping 1 delegate - 1 session facade.
> Normally methods from a facade are "rewritten" to business delegate.
>
> So what is business delegate about?
> - tt hides from a client all complexity connected with network calls,
> i.e. a client invokes some method on a delegate which is a normal java
> object, and delegate uses lookup services to find a target session facade
> - it can catch "network" exceptions and show a client "business"
> exceptions so that a client e.g. does not have to know anything about
> the service distribution
>
> that's what I can help :)
>
> regards
>
> maciek zywno
>
> ====================================================================
> Companion Site: http://www.corej2eepatterns.com
> J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
> List Archive:
> http://archives.java.sun.com/archives/j2eepatterns-interest.html
> Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to
> listserv@(protected)
**************************************************************************
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************

====================================================================
Companion Site: http://www.corej2eepatterns.com
J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.