aspose file tools*
The moose likes JSP and the fly likes Why Use JavaBeans? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Why Use JavaBeans?" Watch "Why Use JavaBeans?" New topic
Author

Why Use JavaBeans?

Paul Hoffman
Greenhorn

Joined: Nov 04, 2005
Posts: 19
Hello all,

Why use JavaBeans? Are JavaBeans anything more than just regular class files that follow certain structural criteria? In all of my research, the word reusability comes up a lot.

Could someone give me a real-world example of where a JavaBean could be used in one application and then re-used in another?

Thanks!
Jherald Lacambra
Ranch Hand

Joined: Feb 02, 2005
Posts: 129
from an article i am reading:

Using beans is a very common practice in JSP application development. This approach is popular because JavaBeans introduces reusability. This is to say, rather than building your own piece of code, you can simply use what other people have written. For example, you can purchase a bean for file upload and start uploading files within 30 seconds.


jherald
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60045
    
  65

Even more than reusability, JavaBeans offer predictability. Because they follow a standard convention, they can be manipulated by reflection so that things like the standard JSP actions and the Expression Language can act upon them.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
chandrakanth boga
Ranch Hand

Joined: Mar 15, 2006
Posts: 49
hello Bear Bibeault ,

i was very happy to see a new word predictibility.
could you explain more about predictibily.
in what way it will be useful for jsp action or jstl
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60045
    
  65

Sorry, I mispelt the word so that might have made it difficult to look up.

It's actually predictability and its definition is here.

Essentially, since beans follow a specific pattern for the accessors and mutators (getters and setters), reflection code can predict how to get and set the properties of a bean.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why Use JavaBeans?
 
Similar Threads
Could Java class instantiate in jsp scriplet
java bean subsystem?
Java Beans Vs EJBs
Tag Library!!!
what is getter/setter in java ?