Business Delegate / Session Facade interaction questions

Discussions

EJB design: Business Delegate / Session Facade interaction questions

  1. I understand the concept and the benefits of a business delegate "front-ending" a session facade but I am looking at a couple of unique situations which I'm not sure how to handle.
     
    Is it acceptable if a business delegate were to front-end more than one session facade in order to create a more unified service. For example is it ok to create one business delegate that provides Account Inquiry and Maintenance functionality and behind the scenes it talks to an AccounInquiry Session Facade and AccountMaintenance Session Facade?
     
    We are looking at a designing a Account Inquiry business delegate. It will return an AccountProfile business object. A behavior of the AccountProfile object will be update capability (i.e. update account status, modify balance, etc.). Considering that the business object is a "business tier" component, is it ok if it were to talk directly to an Account Update Session Facade or instead should it use a business delegate which in turn will call the session facade?
  2. Typically what you would do is provide one facade that unifies n session beans and provide one delegate for that facade.

    In your scenario you would have an AccountInquiry Session Bean, an AccountMaintenance Session Bean, (let's say) an AccountManagementFacade and an AccountManagementDelegate.

    In following this strategy, you would be able to call methods on the delegate where necessary to leverage the delegate/facade patterns and use session beans such as AccountInquiry separately as needed (e.g., internal business component collaboration).
  3. I understand the concept and the benefits of a business delegate "front-ending" a session facade but I am looking at a couple of unique situations which I'm not sure how to handle.  Is it acceptable if a business delegate were to front-end more than one session facade in order to create a more unified service. For example is it ok to create one business delegate that provides Account Inquiry and Maintenance functionality and behind the scenes it talks to an AccounInquiry Session Facade and AccountMaintenance Session Facade?  We are looking at a designing a Account Inquiry business delegate. It will return an AccountProfile business object. A behavior of the AccountProfile object will be update capability (i.e. update account status, modify balance, etc.). Considering that the business object is a "business tier" component, is it ok if it were to talk directly to an Account Update Session Facade or instead should it use a business delegate which in turn will call the session facade?
    I have one example which i came through...

    we have and
    Item module... and PurchaseOrder module
    Item module contains ItemBusinessDelegate,ItemManagerSessionFacade and its Enity beans.

    For creating,editing or deleting the item i neeed only the service of ItemBusinessDelegate.

    PurchaseOrder module[uses Item module]
    Item module contains POBusinessDelegate,POManagerSessionFacade and its Enity beans.

    Now designing POBusinessDelegate is a problem
    one approach
    1.use ItemBusinessDelegate inside the POBusinessDelegate [which is an extensible way]
    2.use ItemBusinessDelegate inside POManagerSessionFacade.[Looks like u r going one layer back]
    3.use the ItemManagerSessionFacade direcly from POManagerSessionFacade
    [this will clutter the code] now u r using the session bean directly.

    for me first approach seems better..

    regards
    joseph antony aruja
    josepha@mastek.com