Part 3: Creating a Session Bean Facade

Previous topic
Previous
Next topic
Next

In this next section of the tutorial, you will add a local reference from the session bean to the entity bean. You will do this to implement the Session Facade design pattern. While clients can interact directly with entity bean, you will find that accessing entity beans through a session bean facade will cut down on network roundtrips, which increases performance.

The session bean will be used for all client interaction. To test this, you'll create a new method in the session bean that will call the findAll() method in the Dept entity bean (this method is generated by default for all entity beans).

You will complete the following steps:

  1. Add a local reference
  2. Add a method to the session bean
  3. Run and test the application