All Examples  All EJB Examples

Package Index

Enterprise JavaBean subclass example
packages and classes

about this example

This example consists of two packages that demonstrate subclassing an Enterprise JavaBean. Please run this example before attempting to create your own Enterprise JavaBeans, as it will show you the different steps involved.

The example is a stateless session EJBean called ParentBean that is the parent class for another EJBean, ChildBean.

The example demonstrates:

The Parent client application performs these steps:
  1. Contacts the Parent home ("Parent") through JNDI to find the EJBean
  2. Creates a Parent
  3. Calls a method of the Parent bean that is overloaded in the Child bean
  4. Calls a method that's unique to the Parent bean
The Child client application performs these steps:
  1. Contacts the Child home ("Child") through JNDI to find the EJBean
  2. Creates a Child
  3. Calls a method that's unique to the Child bean
  4. Calls a method of the Parent bean that is overloaded
  5. Calls a method of the Parent bean that is not overloaded
  6. Calls a method of the Child bean that calls a Parent bean
The package demonstrates how you can use inheritance to simplfy the design of beans where there is common code shared by related beans. See the Child bean example for how this is used.

how to use this example

See the individual examples (parent and child) for instructions on building and running the example. You'll need to build both the parent and child packages before running the child client.

there's more

Read more about EJB in the Developers Guide, Using WebLogic Enterprise JavaBeans.

Copyright © 1997-1999 BEA Systems, Inc. All rights reserved.

Last updated 07/23/1999