In selecting a tool for developing enterprise beans, there are
two basic approaches, with or without an IDE. The steps in this article explain
development without an IDE.
Before you begin
Design a J2EE application and the enterprise beans that it needs.
- For general design information, see "Resources for learning."
- Before developing entity beans with container-managed persistence (CMP),
read "Concurrency control."
About this task
There are two basic approaches to selecting tools for developing
enterprise beans:
- You can use one of the available integrated development environments (IDEs).
IDE tools automatically generate significant parts of the enterprise bean
code and contain integrated tools for packaging and testing enterprise beans.
The IBM WebSphere Application Developer product is the recommended IDE. For
more information, see the documentation for that product.
- If you have decided to develop enterprise beans without an IDE, you need
at least an ASCII text editor. You can also use a Java development tool that
does not support enterprise bean development. You can then use tools available
in the Java Software Development Kit (SDK) and in this product to assemble,
test, and deploy the beans.
The following steps primarily support the second approach, development
without an IDE.
Procedure
- If necessary, migrate any
pre-existing code to the required version of the Enterprise JavaBeans
(EJB) specification.
- Write and compile the components of the enterprise bean.
- At a minimum, an EJB 1.1 session bean requires a bean class, a home interface,
and a remote interface. An EJB 1.1 entity bean requires a bean class, a primary-key
class, a home interface, and a remote interface.
- At a minimum, an EJB 2.x session bean requires a bean class, a home or
local home interface, and a remote or local interface. An EJB 2.x entity bean
requires a bean class, a primary-key class, a remote home or local home interface,
and a remote or local interface. The types of interfaces go together: If you
implement a local interface, you must define a local home interface as well.
- A message-driven bean requires only a bean class.
- For each entity bean, complete work to handle persistence operations.