Java Reference
In-Depth Information
That confessed, we still think our example is the best way to address our
topic. Why? Because EJBs are a large topic, worthy of several topics (and we
encourage you to read some of them, such as Enterprise JavaBeans Component
Architecture by Gail Anderson and Paul Anderson (ISBN 0-13-035571-2). We
simply cannot teach you all about EJBs in our book. Our goal here is to intro-
duce the concepts, provide a working example, and explain how to deploy and
maintain an EJB system on Linux using JBoss. Believe us, we'll have enough
to cover to achieve that modest goal.
21.2.1
In a way, the use of the term Enterprise JavaBean , with its echo of the older
term JavaBean , is unfortunate. Apart from the similar intention of creating
reusable components, the two technologies have little in common.
EJB Concepts
21.2.1.1
Most of the topics on EJBs that we have seen start with the simplest type of
bean and work their way up in complexity. We're going to dare to be different,
because the most complex case isn't that hard, and once you understand it, the
functions of all the other types of EJBs become obvious. They simply don't
implement what they do not need.
For the moment, assume that an EJB is a simple class that provides a set
of methods to clients. The methods represent business functions that clients
want the server to carry out.
Implementing an Enterprise JavaBean requires implementing three Java
source files:
The Life Cycle of an Enterprise JavaBean
• An object that represents the bean implementation
• An interface called the home interface that represents the interface between
the bean and the EJB container
• An interface called the remote interface which represents the methods that
a client may call on the bean
We'll get into the details of these interfaces (and the sometimes obtuse
reasons behind) a little later on. For now, we will concentrate on the
implementation.
The implementation class contains methods that are there only to allow
the container to control the bean and to inform the bean of impending changes
Search WWH ::




Custom Search