Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Java Bean and Enterprise Java Beans? [closed]

Are they different or they are used interchangeably? If they are Different, then what made them different from each other?

like image 224
GuruKulki Avatar asked Mar 17 '10 05:03

GuruKulki


People also ask

What is the difference between JavaBean and enterprise JavaBean?

A JavaBean is a Java class that encapsulates multiple objects and conforms to certain conventions. JavaBeans are used mainly for client-side development. An enterprise bean (EJB) is a Java class imbued with specific server-side capabilities. Enterprise beans are used in large-scale business applications and systems.

What is meant by Enterprise Java Beans?

Enterprise JavaBeans (EJB) is an architecture for setting up program components, written in the Java programming language, that run in the server parts of a computer network that uses the client/server model.

What are different enterprise JavaBean types available?

There are three types of enterprise beans, entity beans, session beans, and message-driven beans. All beans reside in Enterprise JavaBeans (EJB) containers, which provide an interface between the beans and the application server on which they reside.


1 Answers

A JavaBean is just a plain old Java object that conforms to certain conventions including the use of accessor functions (getFoo/setFoo) for member access, provision of a default constructor and a few other things like that.

An Enterprise JavaBean is a component in a Java EE application server which comes in several flavours, the details of which vary by which version of Java EE you're talking about (or, more specifically, which specific set of EJB specifications are involved).

JavaBeans were originally mostly intended to be used in builder tools by providing a known interface which could be looked for through introspection in the tools. They quickly turned into what amounts to a religion, however.

Enterprise JavaBeans are intended to provide encapsulated business logic for enterprise applications within a general container that provided things like session management, security, resource pooling, etc. as services thus allowing the business logic to be (relatively) untainted by these cross-cutting concerns. (Whether or not they accomplished this is a matter that is up for debate, given how difficult they were to use at first. More recent versions of the specification have made this easier, however. Legacy apps, though, are still a pain and sadly likely the majority of the EJBs you're likely to encounter.)


Edited to add:

  • You can read the EJB API right here: http://java.sun.com/products/ejb/javadoc-3_0-fr/
  • You can read the full specification of a JavaBean right here: http://java.sun.com/javase/6/docs/api/java/beans/package-summary.html
like image 128
JUST MY correct OPINION Avatar answered Oct 14 '22 01:10

JUST MY correct OPINION