JavaBeans

This is an old revision of this page, as edited by Chronist~enwiki (talk | contribs) at 19:33, 17 June 2005 (External links: added hard to find tutorial link). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Java Beans are software components written in the Java programming language.

The JavaBeans specification by Sun Microsystems defines them as "reusable software components that can be manipulated visually in a builder tool".

In spite of many similarities, JavaBeans should not be confused with Enterprise JavaBeans (EJB), a server-side component technology that is part of J2EE.

Naming conventions

The source code of a Java Bean is subject to certain naming conventions. These naming conventions make it easier for beans to be reused, replaced and connected.

The naming conventions are:

  • Every java bean class should implement java.io.Serializable interface
  • It should have the 2 argument constructor
  • Its properties should be accessed using get and set methods
  • It should contain the required event handling methods

See also