This discussion is archived
6 Replies Latest reply: Nov 3, 2010 12:15 PM by 269490 RSS

What is the difference between a Business Delegate and a Session Facade?

269490 Newbie
Currently Being Moderated
Is a session facade just a session bean? Is a business delegate a pojo that uses a service locator to locate a session bean?
What is a business service?

Edited by: ttb999 on 2-Nov-2010 5:08 PM
  • 1. Re: What is the difference between a Business Delegate and a Session Facade?
    jduprez Pro
    Currently Being Moderated
    N.B.: this recent topic vastly covers your questions too: {thread:id=1655968}
    Is a session facade just a session bean?
    Why "just"?
    Yes, it's a session bean that fronts other beans. The client code only interacts with the facade, it doesn't have to know about the other beans.
    Is a business delegate a pojo that uses a service locator to locate a session bean?
    It's a POJO that deals with a remote session bean. The way it finds this session bean is its business, a service locator is one of this way but there could be others. The point is that the client code doesn't have to know how to find the session bean itself.
    What is a business service?
    It depends on the context. Infering the context per your other questions, I'd say it's a pure business-logic service (contrasting it with UI, or technical services such as security or persistence).
  • 2. Re: What is the difference between a Business Delegate and a Session Facade?
    269490 Newbie
    Currently Being Moderated
    jduprez wrote:
    N.B.: this recent topic vastly covers your questions too: {thread:id=1655968}
    Is a session facade just a session bean?
    Why "just"?
    Yes, it's a session bean that fronts other beans. The client code only interacts with the facade, it doesn't have to know about the other beans.
    Is a business delegate a pojo that uses a service locator to locate a session bean?
    It's a POJO that deals with a remote session bean. The way it finds this session bean is its business, a service locator is one of this way but there could be others. The point is that the client code doesn't have to know how to find the session bean itself.
    So a facade is a session bean. A business delegate is a pojo that deals with a session bean.
    Do you use a business delegate just so that the code to find the session bean is not in the client code?
    Is that the main reason? There is no real business logic in it?
    What is a business service?
    It depends on the context. Infering the context per your other questions, I'd say it's a pure business-logic service (contrasting it with UI, or technical services such as security or persistence).
    http://www.corej2eepatterns.com/Patterns2ndEd/BusinessDelegate.htm
  • 3. Re: What is the difference between a Business Delegate and a Session Facade?
    269490 Newbie
    Currently Being Moderated
    So then Business Delegates must be on the same JVM as the client class.
  • 4. Re: What is the difference between a Business Delegate and a Session Facade?
    269490 Newbie
    Currently Being Moderated
    Another question that is not directly related to this topic.

    If you are developing a Struts based system, how much logic goes in the Action class?
    Do you create another POJO that the Action class instantiates and that handles most of the logic and is the client that calls the Business Delegate or does most of the processing logic stay in the Action class and it calls the Business Delegate?
  • 5. Re: What is the difference between a Business Delegate and a Session Facade?
    jschellSomeoneStoleMyAlias Expert
    Currently Being Moderated
    ttb999 wrote:
    Do you create another POJO that the Action class instantiates and that handles most of the logic and is the client that calls the Business Delegate or does most of the processing logic stay in the Action class and it calls the Business Delegate?
    Keep in mind that patterns do not constitute absolutes.

    It is possible that if there is no obvious demarcation then it just doesn't fit the model. Thus one puts it where is seems convenient and most useful
  • 6. Re: What is the difference between a Business Delegate and a Session Facade?
    269490 Newbie
    Currently Being Moderated
    jschell wrote:
    ttb999 wrote:
    Do you create another POJO that the Action class instantiates and that handles most of the logic and is the client that calls the Business Delegate or does most of the processing logic stay in the Action class and it calls the Business Delegate?
    Keep in mind that patterns do not constitute absolutes.

    It is possible that if there is no obvious demarcation then it just doesn't fit the model. Thus one puts it where is seems convenient and most useful
    I was just wondering if it made more sense to have a seperate class that could be called by other view technology as well. Or if the fact that the Action class was one instance that would be shared between all JSPs that invoke it might make a difference too (I think I said that correctly) regarding multithreading.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points