ntroduction to Java Beans Development Kit
This module explores the JavaBeans Development Kit (BDK) and the tools and resources it provides for Bean development.
After installing the BDK, you find out what the BeanBox test container is and how it is used to customize and test Beans in a setting similar to application builder tools.
Module learning objectives
After completing the module, I will show you the skills and knowledge necessary to:
- Customize a Bean at design time with the BeanBox
- Test a Bean at runtime with the BeanBox
In the next lesson, I will discuss how to install the BDK.
What do beans provide
But what do beans provide that other classes do not? After all, beans are merely regular Java classes that follow some simple conventions
defined by the JavaBeans specification; beans extend no particular class, are in no particular package, and use no particular interface.
Although it is true that beans are merely Java classes that are written in a standard format, there are several advantages to their use. With beans in general, visual
manipulation tools and other programs can automatically discover information about classes that follow this format and can create and manipulate the classes without the
user having to explicitly write any code. In JSP in particular, use of JavaBeans components provides three advantages over scriptlets and JSP expressions that refer to normal Java classes.
- No Java syntax. By using beans, page authors can manipulate Java objects using only XML-compatible syntax: no parentheses, semicolons, or curly braces.
This promotes a stronger separation between the content and the presentation and is especially useful in large development teams that have separate Web and Java developers.
- Simpler object sharing. When you use the JSP bean constructs, you can much more easily share objects among multiple pages or between
requests than if you use the equivalent explicit Java code.
- Convenient correspondence between request parameters and object properties. The JSP bean constructs greatly simplify the process of reading request parameters, converting from strings, and putting the results inside objects.
As software developers, we are constantly being asked to build applications in less time and with less money.
In addition, these applications are expected to be better and faster than ever before. Object-oriented techniques and component software environments are in wide use now, in the hope that they can help us build applications more quickly.
Development tools like Microsoft's Visual Studio have made it easier to build applications faster by taking a building-block approach to software development. Such tools provide a visual programming model that allows you to include software components rapidly in your applications.
The JavaBeans architecture brings the component development model to Java, and that is the subject of this course.
But before we get started, I want to spend a little time describing the component model, and follow that with a general overview of JavaBeans.