Home

javabeans

JavaBeans are reusable software components for the Java platform. A JavaBean is a Java class that follows a set of conventions and design patterns that enable its properties to be accessed, inspected, and manipulated by development tools and frameworks. The core idea is to provide a simple, standardized way to encapsulate data with properties and behavior that can be manipulated visually in GUI builders and configured in IDEs.

Key conventions include a public no-argument constructor; private properties with public getter and setter methods following

JavaBeans are commonly used as data carriers (plain old Java objects, or POJOs) with property descriptors that

In practice, JavaBeans underpin many GUI components and frameworks, especially in the Swing toolkit and various

the
naming
pattern
getProperty,
setProperty
(or
isProperty
for
boolean
fields);
implements
Serializable
to
support
persistent
storage
or
transmission;
and
well-formed
encapsulation
with
predictable
side
effects.
These
conventions
enable
uniform
access
to
a
bean’s
properties
via
reflection
and
introspection.
can
be
discovered
at
runtime
through
the
Java
Beans
Introspector
(java.beans.Introspector).
Optional
BeanInfo
classes
can
provide
explicit
information
about
properties,
methods,
and
events.
JavaBeans
can
also
fire
property
change
events
via
PropertyChangeListener
to
support
binding
in
UI
frameworks.
visual
builders.
They
are
not
the
same
as
Enterprise
JavaBeans
(EJB),
which
refers
to
a
distinct
server-side
component
model.
While
JavaBeans
can
be
serialized,
persistence
and
remote
invocation
are
not
inherent
to
the
pattern
and
are
typically
addressed
by
other
patterns
or
frameworks.