JavaBeans
lastmod 2018-08-17created 2015-03-054 edits
JavaBeans are software components written in Java.
Sun Microsystems defined the JavaBeans specification as follows: "A reusable software component that can be manipulated visually in a builder tool."
Although they are similar in many respects, JavaBeans should not be confused with Enterprise JavaBeans (EJB). EJB is a server-side component that is part of the Java Platform, Enterprise Edition (Java EE).
| Not to be confused with Enterprise JavaBeans |
Conventions
To function as a JavaBean class, an object class must follow a set of conventions about naming, construction, and behavior. These conventions make it possible to use, reuse, and relocate classes through their connection to JavaBeans in (builder-style) development tools.
The conventions to follow are:
- The class must be serializable. (To persistently save or restore the class's state)
- The class must have a default constructor.
- The class's properties must be accessible through get, set, or other methods that follow standard naming conventions.
- The class must contain any required event-handling methods.