Is it possible to convert a Java Bean to an Enterprise Java Bean (EJB)?

Bozidar Dangubic

I f I have to write EJBs, can I first write JavaBeans and later convert them to EJBs?

Yes, you can convert them later, but keep in mind that Java Beans are client-side objects and EJBs are server side object, and they have completely different development, lifecycle, purpose... They have nothing in common other than the fact that they both have Java Beans in their name.
It is the same as if you ask can you convert any java class into EJB. The answer is still yes given that the class you want to make an EJB does not violate any of the EJB restrictions posed in its specifications.

If you need to write EJBs, it is a big waste of time to create java beans and then convert them to EJBs.
There is absolutely no good reason to do that and many reasons why not to do it.

Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact