In computing based on the
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
Platform, JavaBeans is a technology developed by
Sun Microsystems
Sun Microsystems, Inc. (Sun for short) was an American technology company that sold computers, computer components, software, and information technology services and created the Java programming language, the Solaris operating system, ZFS, ...
and released in 1996, as part of
JDK 1.1.
The 'beans' of JavaBeans are classes that encapsulate one or more
objects into a single standardized object (the bean). This standardization allows the beans to be handled in a more generic fashion, allowing easier
code reuse and
introspection
Introspection is the examination of one's own Consciousness, conscious thoughts and feelings. In psychology, the process of introspection relies on the observation of one's Mental representation, mental state, while in a Spirituality, spiritual c ...
. This in turn allows the beans to be treated as
software components
Component-based software engineering (CBSE), also called component-based development (CBD), is a branch of software engineering that emphasizes the separation of concerns with respect to the wide-ranging functionality available throughout a giv ...
, and to be manipulated visually by
editors and IDEs without needing any initial configuration, or to know any internal implementation details.
As part of the standardization, all beans must be
serializable, have a
zero-argument constructor, and allow access to properties using
getter and setter methods.
Features
;Introspection
:Introspection is a process of analyzing a Bean to determine its capabilities. This is an essential feature of the Java Beans specification because it allows another application, such as a design tool, to obtain information about a component.
;Properties
:A property is a subset of a Bean's state. The values assigned to the properties determine the behaviour and appearance of that component. They are set through a setter method and can be obtained by a getter method.
;Customization
:A customizer can provide a step-by-step guide that the process must follow to use the component in a specific context.
;Events
:Beans may interact with the EventObject EventListener model.
;Persistence
:Persistence is the ability to save the current state