What is Java Beans ?

Java Beans : The specification by Sun Micro system defines Java Beans as reusable software components that can be manipulated visually in a builder tool.

The Java Beans architecture is based on a component model which enables developers to create software units called components.Components are self-contained,resusable software units that can be visually assembled into composite components,applets,applications and servlets using visual application builder tool.Java Beans components are known as Beans.Every Java Bean component should follow java Bean specification ,which define the way by which different components can communicate with each others,interact with a builder tool,save/restore their configuration etc,in addition to this it also defines the architecture of single class in the software component.

A Java bean is a Simple Java class ,adhering to certain conventions about method naming.Constructors and behaviors.The required convention for Java Beans are,
1.It should have no argument constructor so that its object can be created without knowing anything about the Bean.
2.Its Properties must be accessible using getter/setter/and other methods (collectively known as accessor/methods) following a standard naming convention.As the name implies getter method is used to obtain the value of property.

0 comments:

Post a Comment