|
|
JavaBeans help us make our software re-usable.
From the source:
"A bean is a reusable software component based on Sun's JavaBean specification
that can be manipulated visually in a builder tool."
In other words, if we make our Java programs compliant with the JavaBean
standard, they can be dragged and dropped from a menu in a graphical
IDE, such as Sun ONE (Forte'). Further, the properties for these
beans can be set in a dialog box instead of the code itself, and the IDE
handles the code generation.
Thus, we gain two efficiencies: re-use of software, and shorter learning
curve for novice developers.
As a matter of fact, you've probably already used JavaBeans. Most
of the examples in my previous classes (Java I and II) are JavaBeans compliant,
and Swing is entirely JavaBean based.
A warning, don't confuse JavaBeans with Enterprise Java Beans (EJBs).
Though very similar in nature, JavaBeans are essentially pluggable components.
EJBs, however, are much more complex. The EJB standard includes database
communication, network communication, and more. But, JavaBeans certainly
are part of EJBs, and knowing JavaBeans is crucial to learning EJB.
Designing a JavaBean
|