 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
pokaru Guest
|
Posted: Sun Dec 03, 2006 1:01 am Post subject: What's a JavaBean? |
|
|
Obviously, I'm new to JavaBeans. Could someone please break it down for me,
what they are, and what they're good for?
I hope it's true what they say, "There's no dumb question." .
Thanks everyone.
- Peter |
|
| Back to top |
|
 |
Lion-O Guest
|
Posted: Sun Dec 03, 2006 8:10 am Post subject: Re: What's a JavaBean? |
|
|
| Quote: | Obviously, I'm new to JavaBeans. Could someone please break it down for me,
what they are, and what they're good for?
|
A JavaBean is basicly an independent Java class which conforms itself to some
specific implementation rules. For example; if you wish to set a value in a
javabean you'd be using a so called "setter". Its basicly a method which 'sets'
a value to a private variable in the bean. Getting such a value is done using a
'getter'.
And because all of those things are standards any program which needs to get,
for example, an "adress" variable out of a bean can know up front that it'd be
using "beanname.getAddress()" to get the value and "beanname.setAddress()" to
actually set it.
You can get more info on the subject here:
http://java.sun.com/products/javabeans/docs/index.html
http://java.sun.com/products/javabeans/docs/spec.html
--
Groetjes, Peter
..\\ PGP/GPG key: http://www.catslair.org/pubkey.asc |
|
| Back to top |
|
 |
arad Guest
|
Posted: Tue Jan 23, 2007 6:41 pm Post subject: Re: What's a JavaBean? |
|
|
pokaru ÃÑÓáÊ:
| Quote: | Obviously, I'm new to JavaBeans. Could someone please break it down for me,
what they are, and what they're good for?
I hope it's true what they say, "There's no dumb question." .
Thanks everyone.
- Peter
|
java beans is class that deal with data processing that's it !
if you have jsp page and you want to retreive the
data from Database such as Oracle or DB2 you can make java bean to
retreive data and you will use jsp:useBean tag in the jsp page by this
way you separate the presentation from process data
ofcourse the javabean class has some properities that you must follow
it when you create a bean like setter & getter methods and empty
constructor . |
|
| Back to top |
|
 |
Lion-O Guest
|
Posted: Wed Jan 24, 2007 3:29 pm Post subject: Re: What's a JavaBean? |
|
|
| Quote: | java beans is class that deal with data processing that's it !
|
Thats not entirely true. When I create a java program and setup an executable
jar for it its not that hard to add a line to my manifest file saying:
"Java-Bean = true" after which Java will consider it to be a java bean ;)
A javabean is not merely a class; taken as a whole its a platform-independent
component model. It may utilize the beans class, but thats not a requirement to
produce a javabean.
--
Groetjes, Peter
..\\ PGP/GPG key: http://www.catslair.org/pubkey.asc |
|
| Back to top |
|
 |
mei Guest
|
Posted: Mon Feb 12, 2007 3:40 am Post subject: Re: What's a JavaBean? |
|
|
Sorry to interfere in this thread, but i've been confused by this post.
It seems to me that you distinguish java beans and beans.
So the beans are those classes that complies to the setters and getters
stuffs... So now, what are the javabean? In particular, in your example,
what happens exactly when you set "Java-Bean" property to true?
Thanks.
Lion-O a écrit :
| Quote: | java beans is class that deal with data processing that's it !
Thats not entirely true. When I create a java program and setup an executable
jar for it its not that hard to add a line to my manifest file saying:
"Java-Bean = true" after which Java will consider it to be a java bean ;)
A javabean is not merely a class; taken as a whole its a platform-independent
component model. It may utilize the beans class, but thats not a requirement to
produce a javabean.
|
|
|
| Back to top |
|
 |
Frank Fredstone Guest
|
Posted: Sat Mar 03, 2007 4:19 am Post subject: Re: What's a JavaBean? |
|
|
mei <mei (AT) you (DOT) fr> writes:
| Quote: | Sorry to interfere in this thread, but i've been confused by this post.
It seems to me that you distinguish java beans and beans.
So the beans are those classes that complies to the setters and
getters stuffs... So now, what are the javabean? In particular, in
your example, what happens exactly when you set "Java-Bean" property
to true?
Thanks.
|
Aside from indicating that the main class in the jar file is a java
bean, I'm not sure. Maybe that is how the environment that gives you
an interface (e.g. GUI) to bean customizers, determines which classes
to present as components.
I am also confused about javabeans. A javabean is not "a class with
getters and setters". A javabean is a java component that can be
designed to reveal information about itself, such as what component
properties are accessible.
A javabean component can be setup to be customizable in a property
editor.
What I don't understand though, is how a customized javabean is then used. In:
http://java.sun.com/docs/books/tutorial/javabeans/index.html
a lot is described, but not how a customized bean would be used from
an application.
In the tutorial the application making use of the component model is
the NetBeans IDE, where NetBeans presents a GUI to a property editor
and allows components to be associated with each other.
It would clear things up for me if I could see an example of a non-GUI
application making use of non-GUI components that have been customized
in a property editor. |
|
| Back to top |
|
 |
levilista@gmail.com Guest
|
Posted: Sun Apr 08, 2007 9:59 pm Post subject: Re: What's a JavaBean? |
|
|
I'm a newbie to beans too.
I second Frank's question:
A database query can be a component too. How does a graphical property
editor deal with it?
Frank Fredstone írta:
| Quote: | mei <mei (AT) you (DOT) fr> writes:
Sorry to interfere in this thread, but i've been confused by this post.
It seems to me that you distinguish java beans and beans.
So the beans are those classes that complies to the setters and
getters stuffs... So now, what are the javabean? In particular, in
your example, what happens exactly when you set "Java-Bean" property
to true?
Thanks.
Aside from indicating that the main class in the jar file is a java
bean, I'm not sure. Maybe that is how the environment that gives you
an interface (e.g. GUI) to bean customizers, determines which classes
to present as components.
I am also confused about javabeans. A javabean is not "a class with
getters and setters". A javabean is a java component that can be
designed to reveal information about itself, such as what component
properties are accessible.
A javabean component can be setup to be customizable in a property
editor.
What I don't understand though, is how a customized javabean is then used.. In:
http://java.sun.com/docs/books/tutorial/javabeans/index.html
a lot is described, but not how a customized bean would be used from
an application.
In the tutorial the application making use of the component model is
the NetBeans IDE, where NetBeans presents a GUI to a property editor
and allows components to be associated with each other.
It would clear things up for me if I could see an example of a non-GUI
application making use of non-GUI components that have been customized
in a property editor. |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|