Results 1 to 3 of 3
  1. #1
    williamshen25 is offline Member
    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0

    Default Business Delegate and Session Facade usage.

    Hi guys.

    I am new to JavaEE and I recently learnt the Business Delegate and Session Facade design patterns. The tutorials from Oracle did gave me a basic idea of what they are and why they are used, but the example didn't really answer all my questions. So I decided to use a real life scenario here and put my question in to it. Any help is appreciated.

    Assume I want to create a search employee page for my company, the employees are categorized by his or her department and the province he or she is in. I have in the database a look up table for department and province. (as shown in the image below)

    Business Delegate and Session Facade usage.-3-5-2013-5-53-51-pm.png
    http://oi46.tinypic.com/idvpsl.jpg

    So I create three JPA entities, one for each table. Now I am stuck with what is the proper way to design the session facade design pattern. I know that I will need the to access all three entities in my page. (to get the drop down list for Provinces and Departments, and to retrieve list of Employees based on the selection) So should I create a Stateless Session Bean as session facade to access all three JPA Entities or should I create three separate Stateless Session Bean to manage one Entity each?

    I came up three component diagram in the below picture.
    The first one has one Stateless Session Bean as session facade and manages all three Entities.
    The second one has a session facade to manage the relationship between business objects such as ProvinceManagerEJB and DepartmentManagerEJB which will manage the corresponding Entities.
    The last one has three Stateless Session Beans that will manage one Entity each, all three Stateless Session Beans can be looked up via the Business Delegate pattern.

    Business Delegate and Session Facade usage.-3-5-2013-6-01-10-pm.png
    http://oi46.tinypic.com/10pqets.jpg

    Please let me know if any one of them is the proper way to use business delegate and session facade. or none of them is correct. (which I assume might happen)

    Again, thank you so much for your help.

    Cheers

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,422
    Rep Power
    20

    Default Re: Business Delegate and Session Facade usage.

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    williamshen25 is offline Member
    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0

    Default Re: Business Delegate and Session Facade usage.

    Quote Originally Posted by DarrylBurke View Post
    sorry for cross posting, but the previous forum couldn't show my diagrams. I found this one can.

Similar Threads

  1. facade and collections
    By Danieldcc in forum New To Java
    Replies: 12
    Last Post: 03-31-2012, 11:47 PM
  2. does java have delegate like c#
    By trathanhcao in forum New To Java
    Replies: 5
    Last Post: 01-17-2012, 09:21 PM
  3. does java have delegate like c#
    By trathanhcao in forum AWT / Swing
    Replies: 2
    Last Post: 01-17-2012, 08:28 AM
  4. facade pattern
    By hannes in forum AWT / Swing
    Replies: 6
    Last Post: 02-10-2010, 12:28 AM
  5. Delegate Control from one Application to another
    By saikumarkomati in forum Advanced Java
    Replies: 4
    Last Post: 01-24-2009, 04:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •