aspose file tools
The moose likes EJB and other Java EE Technologies and the fly likes New project - JavaBeans Vs. EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "New project - JavaBeans Vs. EJB" Watch "New project - JavaBeans Vs. EJB" New topic
Author

New project - JavaBeans Vs. EJB

Dewang Shahu
Greenhorn

Joined: Apr 05, 2001
Posts: 6
We have an opportunity in our org. to introduce a web based project. We don't have App. server but the idea is to get WebLogic in the future.
Our confusion is that if we start with JavaBeans/servlets/JSP for a proof of concept, would it be possible to convert JavaBeans to EJB in the future without much trouble? Thanks in advance for any help.
raj sb
Greenhorn

Joined: Dec 02, 2001
Posts: 6
Hi Dewang,
Simple Java beans are totally different from EJBs. So you have to re-code all the logic again. U will have the logic but the only trouble will be the re-coding and that also on different concept.
cheers.
Bill Siggelkow
Ranch Hand

Joined: Jun 27, 2001
Posts: 57
If you are building a web app, it is perfectly legit to simply use JavaBeans/servlets/JSP for the proof of concept on something like Tomcat.
Even if you move to using EJBs in the future, you will still need the JavaBeans to act as the model for the presentation layer. Personally, I like to use a combination of interfaces for the business objects and controllers or factories that create instances of those interfaces. Then my JavaBeans implement those interfaces. In an implementation without EJBs the factories call on back-end data access objects or other back-end components ... to move to EJBs I simply swap out the back-end components with EJBs.

Bill Siggelkow
Jade Cove Solutions
Melissa Rabin
Greenhorn

Joined: May 30, 2001
Posts: 3
Hiya Dewang. In terms of the Beans to EJB conversion, there really is no easy method - at least none that I have discovered. However, I recently explored a little codegen called Jostraca (http://sourceforge.net/projects/jostraca/) that we used to generate EJB's as well as JavaBeans. It's Platform independent & GNU independent licensed. Jostraca's flexible enough to allow for customization in any J2EE project, yet lightweight & relatively easy to learn. In essence, it's an XML format for specifying attributes fields that can be easily specified after development. If you start your project off using this codegen (or one that is similar), you can initially use it to generate your Java Beans, and future "conversion" to EJB's should go a lot faster.

Melissa
Web Engineer

"...Our confusion is that if we start with JavaBeans/servlets/JSP for a proof of concept, would it be possible to convert JavaBeans to EJB in the future without much trouble? Thanks in advance for any help...."
Vladimir Ergovic
Ranch Hand

Joined: Apr 22, 2001
Posts: 63
It depends about volume of work and the size of the project. If it is something simple and short I would say that JavaBeans with some classes with static methods for database would be just fine and fast to build and to execute. However if it is large project you should consider EJB - no handling transactions and connection pooling manually (extra time) + CMP and that looks fine. They are more robust and good choice for large projects.
Usually JavaBeans in web app are just wrapper classes with some minor business logic - to convert that to EJB you would have a lots of fun! Also I have experience with both soultinos under Oracle, mySQL and Access. These last two and similar databases are usually not a problem because there is no hard load on it. However Oracle was usually on the seperate machine and connection pooling was needed because those were large applications with a lot of users on it - that case EJB.

Vladimir Ergovic
Dewang Shahu
Greenhorn

Joined: Apr 05, 2001
Posts: 6
Thanks everyone for your help. Much appreciated.
Dewang Shahu, SCJP
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: New project - JavaBeans Vs. EJB
 
Similar Threads
Why EJB ?
diffrence between javabeans and ejb
What Is The Difference Between JavaBeans and EJB?
diff. between javabeans & ejb
Market value of SCJP in USA