Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Java Beans

Hi, I haven't gotten into Java Beans yet and was wondering what they are.
What makes them different from Java applications and Java applets? What
is their main function, what makes them different?
[210 byte] By [Texas Ranger] at [2007-11-9 21:18:07]
# 1 Re: Java Beans
Hello:

Beans provide a reusable, component based architecture to Java programs.
They're usually hosted by a container such as an applet or application and
perform some specific function. Beans have some conventions to be followed
when designing them but they are relatively straightforward Java classes
with properties (variables), getters, setters, and intrinsic methods.

Tom Duffy

"Texas Ranger" <bug@brick.com> wrote:
>
>Hi, I haven't gotten into Java Beans yet and was wondering what they are.
> What makes them different from Java applications and Java applets? What
>is their main function, what makes them different?
Tom Duffy at 2007-11-11 23:10:10 >
# 2 Re: Java Beans
Javabeans can be used for just about anything. Some people say that they have
to implement the serializable interface to be a true bean, but I disagree.
Tha main thing to look for in a javabean is what you are using it for and
what it is doing. If it is mainly doing "set" and "get", I would qualify
it as a bean. You can argue that a normal java class can do this and that
is true, but I believe it is what you are doiong with that class that qualifies
it as a javabean. For example, a clear case would be a customer bean during
a session, which get's all of his attributes set/get during a visit. It is
definitely a logical decision more than a coding one as to what you will
design as a bean or not. If the class is mainly getting and setting and has
to be used often and easily modified to reflect changes in business logic
I like to make it a bean.

Reid
tagreid@hotmail.com

"Tom Duffy" <td4729@hotmail.com> wrote:
>
>Hello:
>
>Beans provide a reusable, component based architecture to Java programs.
> They're usually hosted by a container such as an applet or application
and
>perform some specific function. Beans have some conventions to be followed
>when designing them but they are relatively straightforward Java classes
>with properties (variables), getters, setters, and intrinsic methods.
>
>Tom Duffy
>
>"Texas Ranger" <bug@brick.com> wrote:
>>
>>Hi, I haven't gotten into Java Beans yet and was wondering what they are.
>> What makes them different from Java applications and Java applets? What
>>is their main function, what makes them different?
>
tagreid at 2007-11-11 23:11:05 >