• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why Use JavaBeans?

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 guess everyone has an angle. Fine, what do you want? Just know that you cannot have this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic