Tuesday, November 22, 2005

JavaBeans versus Enterprise JavaBeans

Yeah, my new distrubuted objects course project is about EJB. I have already started to study it. I will talk about it later. But for now I want to mention difference between JavaBeans and Enterprise JavaBeans. There are two kinds of javabeans in java and if you are new in this subject you can easily get confused.
Here is a short definition from Mastering EJB book(3th edition pg:16) :

"You may have heard of another standard called JavaBeans. JavaBeans are
completely different from Enterprise JavaBeans.
In a nutshell, JavaBeans are Java classes that have get/set methods on them.
They are reusable Java components with properties, events, and methods
(similar to Microsoft ActiveX controls) that can be easily wired together to
create (often visual) Java applications.
The JavaBeans framework is lightweight compared to Enterprise JavaBeans.
You can use JavaBeans to assemble larger components or to build entire
applications. JavaBeans, however, are development components and are not
deployable components. You typically do not deploy a JavaBean; rather,
JavaBeans help you construct larger software that is deployable. And because
they cannot be deployed, JavaBeans do not need to live in a runtime
environment and hence, in a container. Since JavaBeans are just Java classes,
they do not need an application server to instantiate them, to destroy them,
and to provide other services to them. An EJB application can use JavaBeans,
especially when marshalling data from EJB layer to another, say to components
belonging to a presentation tier or to a non-J2EE application written in Java."

train once, code anywhere; write once, run anywhere...

No comments: