Difference Between Bean, Java Bean, and Enterprise Java Beans

I read about EJB, Java Beans, however I still have doubts as to what the term itself means

A) Is there a simple term "bean"?

B) Now transition to Java Beans. As I read it is just a simple POJO that follows some naming conventions and they have getter and setters? However, I am having a hard time understanding how this convention makes them "reusable components" as I read in many posts including SO.

There are a couple of SO posts similar to this, however this is different: I am asking if the term "w810>" exists; and why java Beans are reusable components.

Can someone clarify this in simple terms.

+3


source to share


1 answer


The simple term "bean" is often used as a shortcut to a JavaBean or Enterprise Java Bean (depending on the context). So this term exists in the general language of programmers and it generally refers to reusable objects / components in Java.

JavaBean is a POJO class with specific naming conventions for getters and setters, true and not only: it is usually an encapsulation of other objects (properties), serializable and a constructor with a null argument. There is a complete specification developed by Sun (at the time) about the JavaBean. Sun has defined it as "a reusable software component that can be visually manipulated in a build tool." Moreover, the JavaBean specification states that:

Individual Java Beans will differ in the functionality they support, but the typical unifying features that distinguish Java Beans are:



  • "Introspection" support so the builder tool can analyze how the Bean works
  • Support for "customization" so that when using the app builder, the user can customize the look and feel of the bean
  • Support for "events" as a simple communication metaphor than can be used to connect beans
  • Support for "properties", both for customization and for use in programs.
  • Save support so that the Bean can be configured in the builder application and then its customized state is saved and reloaded later.

The essential part is that it can be visually manipulated, hence the need for getters / setters, events, a null argument constructor (so they can be instantiated externally), serialisable.

Check out this link for more details: http://download.oracle.com/otn-pub/jcp/7224-javabeans-1.01-fr-spec-oth-JSpec/beans.101.pdf?AuthParam=1435694253_b87821c280430a0230bf8d22223c79d2

+2


source







All Articles