aspose file tools*
The moose likes Beginning Java and the fly likes Classes or Beans? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Classes or Beans?" Watch "Classes or Beans?" New topic
Author

Classes or Beans?

Paul Richards
Greenhorn

Joined: Jul 25, 2001
Posts: 19
Just a general question for you all.
Is it better to develop java classes or java beans.
I know that java beans are generally used for developing GUI applications( I have used them for developing with JSP's and Websphere studio).
As I am using Visual Age for Java 3.5 creating beans is fairly easy as the bean info class is generated for you corectly if you follow the correct procedures.
What I would like to know is there any advantages of using classes instead of beans and visa versa? Are there any performance issues etc.
Thanks in advance
Paul
Bill Siggelkow
Ranch Hand

Joined: Jun 27, 2001
Posts: 57
To be precise, Java Beans are simply classes that follow certain rules. There should be nothing wrong with letting a tool generate beans for you. In general, when I am developing classes I try and adhere to the Java Beans get/set naming pattern ... using that convention also makes it easier to use Java reflection with your code.
The BeanInfo class is not required for a Java Bean, though it is particularly useful for UI beans (such as labels, text fields, etc.).


Bill Siggelkow
Jade Cove Solutions
Ivan Tamayo
Ranch Hand

Joined: Aug 13, 2001
Posts: 49
Beans are classes that follows a convention. They�re util for reusability and GUI.
John Kilbourne
Ranch Hand

Joined: Aug 22, 2001
Posts: 30
What makes a bean a bean; why are they special?
I've read that they are reusable software components, but that doesn't tell me much. When would you *use* them? Also, I get the sense that enterprise java beans are not the same as java beans. What is the scoop on that/
Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Classes or Beans?