Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Classes or Beans?

 
Paul Richards
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.).
 
Ivan Tamayo
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Beans are classes that follows a convention. They�re util for reusability and GUI.
 
John Kilbourne
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic