Java Beans:
Java Bean is software component that has been designed to be reusable in a variety of different environments.There is no restriction on the capability of a bean.It may perform a simple function such as obtaining an inventory value,or a complex function,such as forecasting the performance of stock portfolio. A bean may be visible to an end user. one example of this is a button on a graphical user interface. A bean may be invisible to an user it is nothing but the software to decode a stream of multimedia information in real time is an example of this building block.
Finally bean may be designed to work autonomously on a user's workstation or to work in cooperation with a set of other distributed components.software to generate a pie chart from a set of data points is an example of bean that can execute locally.
Advantages:
1.A bean provides all the benefits of Java's "write once, run anywhere" paradigm
2.The properties, events, and methods of a bean that are exposed to another application can be controlled.
3.A bean may register to receive events from other objects and can generate events that are sent to those other objects
4.Auxilary software can be provided to help a person configure a java bean
5.The configuration setting of bean can be saved in a persistent storage and restored at a later time
Disadvantages: 1. A class with a nullary constructor is subject to being instantiated in an invalid state. If such a class is instantiated manually by a developer (rather than automatically by some kind of framework), the developer might not realize that the class has been improperly instantiated. The compiler can’t detect such a problem, and even if it’s documented, there’s no guarantee that the developer will see the documentation.
2.Having to create a getter for every property and a setter for many, most, or all of them can lead to an immense quantity of boilerplate code.
No comments:
Post a Comment