Results 1 to 4 of 4

Thread: How to implement Session Beans in Business delegate class?

  1. #1
    Join Date
    Feb 2009
    Posts
    105

    How to implement Session Beans in Business delegate class?

    Hi All,

    I am neither very familiar with BD nor EJB. So please correct me if anything that I say is wrong.

    I am deevloping an EJB2 application. We have different components and each component is a session bean. Now i am trying to implement the BD pattern.

    From my understanding the BD class will be in the presentation tier. Now wat I am not clear about is will all the Service beans have its own BD class.

    Say I have 2 components Staff and Students or will it be just one BD tat calls up a Service Locater to get the Service bean depending on the type of request.

    Thanks

  2. #2
    Join Date
    Jan 2009
    Posts
    120

    Re: How to implement Session Beans in Business delegate class?

    The EJB Layer is composed of Business objects, which are session beans, entity beans and DAOs (Data Access Objects). Working as an entry-point to the EJB Layer, the SessionFacade is a session bean that manages the relationships between numerous BusinessObjects to provide higher-level abstraction to the client.

    By employing the SessionFacade, the client is provided with a coarse-grained way to access the EJB Layer. The client uses the SessionFacade instead of dealing with more fine grained components from the EJB Layer.

    In summary, the SessionFacade provides a simpler interface to the clients by hiding all the complex interactions between business components. The SessionFacade reduces the number of business objects that are exposed to the client across the service layer over the network. The SessionFacade also prevents the exposure of the underlying business objects directly to the client, keeping the client and the EJB layer loosely coupled.

  3. #3
    Join Date
    Jan 2009
    Posts
    143

    Re: How to implement Session Beans in Business delegate class?

    Definitively a normal java class.
    The goals of the business delegates are :

    1 - Delegate method calls to EJB (that why the pattern has this name, clever, no )
    2 - Hide EJB complexity (remote exception and EJB specific stuff)
    3 - Decouple the client layer from the business layer
    You cannot achieve these goals with an EJB. So you're business delegate must ba a plain java object.
    The usual architecture is :
    Client --> Business Delegate --> EJB Session Facade --> EJBs (Session or entity)

  4. #4
    Join Date
    Dec 2008
    Posts
    69

    Re: How to implement Session Beans in Business delegate class?

    Business Delegate is to reduce coupling between client and business objects. One of the basic example is, if you use a method from business object in your clients, let say in 10 servlets, if the method signature changes on the business object, you have to change in all(10) your client places(ofcourse, IDE can easily refactor it, but it will be complicated if the project is very big). To avoid this, have a layer of classes/interfaces which have the methods corresponding to each business object.

    Session Facade is to reduce the number of network calls made from client to business objects. As you said, if you implement the business logic in your Business Delegate layer, you will be making multiple fine grained calls to your business objects to complete a Use Case. Network calls are expensive and must be reduced. So instead of implementing the business logic in clients, implement it in business object layer and send required data as a bundle(coarse grained).

Similar Threads

  1. Abstract class unable to implement List<T>
    By MAHESA in forum Software Development
    Replies: 5
    Last Post: 02-03-2010, 09:00 PM
  2. An instance of class Business works for many forms
    By AMISH in forum Software Development
    Replies: 3
    Last Post: 26-11-2009, 08:47 PM
  3. Replies: 3
    Last Post: 12-09-2009, 09:48 AM
  4. Servlet to call Session beans during runtime
    By Pikachoo in forum Software Development
    Replies: 3
    Last Post: 01-04-2009, 09:47 AM
  5. AMD to release Six 45nm Business class CPUs in Q3
    By marlyn in forum Portable Devices
    Replies: 2
    Last Post: 06-01-2009, 12:08 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,518,136.06083 seconds with 16 queries