A component is a software object that has the following elements
A component Framework is the design of a set of API's that allow software developers to define a software components that can be dynamically combined together to create an application. A component Framework consists of two major elements :components and containers.
Components can have a visual appearance such as a button and can be non-visual such as a data feed monitoring component.
Containers are used to hold an assembly or related components. Containers provide the context for components to be arranged and interact with one another. Containers are sometimes reffered to as forms, pages frames or shells, Containers can also be used as components i.e. a container can be used as a component inside another container.
Since it's a "component architecture" for Java, Beans can be used in graphical programming environments, like Borland's JBuilder, or IBM's VisualAge for Java. This means that someone can use a graphical tool to connect a lot of beans together and make an application, without actually writing any Java code -- in fact, without doing any programming at all. Graphical development environments let you configure components by specifying aspects of their visual appearance (like the color or label of a button) in addition to the interactions between components (what happens when you click on a button or select a menu item).
One important aspect of Java Beans is that components don't have to be visible. This sounds like a minor distinction, but it's very important: the invisible parts of an application are the parts that do the work. So, for example, in addition to manipulating graphical widgets, like checkboxes and menus, Beans allows you to develop and manipulate components that do database access, perform computations, and so on. You can build entire applications by connecting pre-built components, without writing any code.
A "bean" is just a Java class with additional descriptive information. The descriptive information is similar to the concept of an OLE type library, though a bean is usually self-describing. Any Java class with public methods can be considered to be a bean, but a bean typically has properties and events as well as methods.
Introspection Because of Java's late binding features, a Java .class file contains the class's symbol information and method signatures, and can be scanned by a development tool to gather information about the bean. This is commonly referred to as "introspection" and is usally done by applying heuristics to the names of public methods in a Java class.
For those who are queasy about the idea of enforced naming conventions, JavaBeans provides an alternate approach. Explicit information about a class can be provided using the BeanInfo class. The programmer sets individual properties, events, methods using a Bean Info class and several descriptor class types (viz. Property Descriptor, for specifying properties or the Method Descriptor for specifying methods). To some extent, naming conventions do come into play here as well, as when defing the a BeanInfo class. When an RAD Tool wants to find out about a JavaBean, it asks with the Introspector class by name, and if the matching BeanInfo is found the tool uses the names of the properties, events and methods defined inside that pre-packages class. If not the default is to use the reflection process to investigate what methods exist inside a particular JavaBean class.
Design Patterns
The Beans specification refers to these heuristics of introspection and reflection as "design patterns".
Property
The property metaphor in Java esentially standardizes what is common practice both in Java and other object-oriented languages.
Properties are set of methods that follow special naming conventions. In the case of read/write properties, the convention is that if the property name is XYZ, then the calss the methods setXYZ and getXYZ respectively. The return type of the getter method must match the single argument to the setter method. Read-only or write-only properties have only one of these methods.
Boolean properties can have a getter method of the form isXYZ in addition to or instead of getXYZ.
Indexed Properties , are also supported in Beans, which set or get an indexed value. Indexed properties take an additional integer parameter in their getter and setter methods.