You now have the DemoBean example working and you have sucessfully
run the client. If so, then you should now also have some feel for
the required parts of an Enterprise JavaBeans application, and how
easy it is to create real distributed multitier applications.
Basic Recipe
An important thing to notice is that while the design and implementation
of a "real" application might take a lot more time, and involve
far more complex logic to model the business, the recipe is basically the
same. The Java programmer follows the steps of specifying the interfaces,
remote, home, and so on, and then writing the logic in the bean, as per
the example recipe.
What You Didn't Do
In Enterprise Java beans much of the strength of the model comes from what
the programmer does not have to do, for instance Java programmers no longer
have to learn CORBA IDL, nor do they have to handle multithreading issues.
Indeed explicit creation of threads by the Enterprise JavaBeans programmer
is illegal in any Enterprise JavaBeans-compliant container/server--this is
the function of the server/container vendor. Other things the Enterprise
JavaBeans programmer does not have to code include: security issues (these
are declared in the DeploymentDescriptor), anything to do with the underlying
protocol, and anything that is platform-specific.
Next Steps
While simple examples are good to learn on, they can also be annoying
in what they don't cover. Specifically not covered in this example is any
type of database access. Hence security and transactional issues are well
highlighted, although as stated above there is little application programming
to be done for these. Also in both stateful-session beans, and entity beans
there is a little more work to do to utilise the "state" kept on
the server, and this is not highlighted.
One final point is that sophisticated tools for Enterprise JavaBeans
development are on their way from many of Sun's partners, and much of
the work done by hand in creating and declaring of interfaces and so
on, will become much simpler, for example, as simple as clicking a button!
In Conclusion
It is hoped this introduction has helped you to see the strengths of
the Enterprise JavaBeans model, and whether you are a seasoned CORBA,
Perl, or even VB programmer, it is hoped you will start to see just how
easy and powerful Enterprise JavaBeans can be!
About the Authors
Tom Daly and Uday Shetty work in Market Development engineering
at Sun. Tom Daly has a background in Enterprise systems management
and performance testing and has been working with Java technology
since the alpha 0.3 release. Uday Shetty has been working for some
time with application servers.
Click here to return to the Enterprise
JavaBeans Tutorial Index page.
Reader Feedback
Tell us what you think of this article and earn 2 DukeDollars.