File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes How Java Bean is reusable software component ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How Java Bean is reusable software component ?" Watch "How Java Bean is reusable software component ?" New topic

How Java Bean is reusable software component ?

siva chaitanya
Ranch Hand

Joined: Jul 05, 2011
Posts: 59
Please i request don't give me outdated answers i keep on searching in the Google but my doubt is not clear . Reusable means java bean that is developed in one project can be used in another project right how it is possible to use in another project and what is the difference between EJB and java bean
Mansukhdeep Thind
Ranch Hand

Joined: Jul 27, 2010
Posts: 1157

Well, let's say you are asked to build a GUI using SWING. Now what would happen if you did not have any pre-defined menu-bars, buttons, drop downs, text fields etc? Wouldn't every developer have to write it again and again? That is what you mean by reusable.

~ Mansukh
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46320
Start with this tutorial.
Amit Ghorpade

Joined: Jun 06, 2007
Posts: 2851

Java beans are basically data holders. They are populated by the front end or the database and stored or presented on the other end. The link provided by Campbell above shows how you can write your own beans.
I would not refer a drop-down or a text-field as a Java bean though.
The any class can be re-usable provided the current and future implementations have common purpose for the class. Utility classes are the most re-used components.
EJB's are a whole different thing and they cannot be compared to Java beans. There is no point in finding similarities or differences among these two.

|Asking Good Questions|
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Regarding the difference between JavaBeans and EJB: see and the link titled "EJB and JavaBeans" at the bottom of this page.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63838

rajesh villuri,
Your post was moved to a new topic.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: How Java Bean is reusable software component ?
It's not a secret anymore!