All Examples  All EJB Examples

Package examples.ejb.subclass

Enterprise JavaBean subclass example
packages and classes

about this example

This example demonstrates 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 EJB called ChildBean that extends the ParentBean class.

The example demonstrates:

The Client application performs these steps:
  1. Creates a ChildBean
  2. Calls a method that's overloaded by the ChildBean class
  3. Calls a method that's inherited from the ParentBean class
  4. Calls a method that only exists in ChildBean
  5. Removes ChildBean
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

To get the most out of this example, first read through the source code files. Start with the XML deployment files to find the general structure of the EJBs, which classes are used for the different objects and interfaces, then look at the client code see how the application works.

This example is shipped "pre-built"; you can either run it as shipped, or build the example and run it to test that you are able to successfully build and run EJBeans. See Building Enterprise JavaBeans examples for more information.

there's more

Read more about EJB in BEA WebLogic Server Enterprise JavaBeans.

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

Last updated 03/28/2000