| Author |
What we can write in Java Beans except setter and getter?
|
ronney singh
Ranch Hand
Joined: Feb 10, 2012
Posts: 40
|
|
Hello to all the members,
I have been using Java Beans only for putting my setter and getter in it. I want to know that Is there anything else we can write in the EJB's except setter and getter?
Thanks in Advance
Ronney Singh
|
Live Life King Size
|
 |
caleb momanyi
Ranch Hand
Joined: Jun 17, 2012
Posts: 43
|
|
|
they are just java classes and you can write anything in them. that's my opinion.
|
 |
Jelle Klap
Bartender
Joined: Mar 10, 2008
Posts: 1430
|
|
A JavaBean is not the same thing as an EJB.
The JavaBean specification defines a set of rules / conventions that, if complied with, make a plain old Java object (POJO) a valid JavaBean. The purpose of that is to turn a Java objects into components that can be easily shared and plugged / composed into applications. What you seem to be focussing on is only one aspect of the JavaBean specification, which are properties (not to be confused with the language construct that Java does not provide), but the JavaBean specification also allows for public methods besides the methods related to properties. There are also the the event and persistence (serialization) facilities.
The EJB specification is also a set of rules that turn Java objects into components, but the key difference is that these components must be managed by an application server and the specification is far more extensive, covering the component lifecycle, transactions, concurrency, scheduling, naming, remoting, security and more.
|
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
|
 |
 |
|
|
subject: What we can write in Java Beans except setter and getter?
|
|
|