Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

When to use Java Beans and when EJB

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello alltogether,
when i start developing an application based on an application server e.g. tomcat, when do i decide to use EJBs and when can i use Java Beans?
How much more effort will it be to develop EJBs in compare to Java Beans.
I think of following architecture:
M: JSPs
V: JavaBeans / Servlets
C: Java Beans / EJBs
When to choose what?
Thanks for Help
Ci
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I think you wanted the Web Developer Exam forum for this question.
But you use a JavaBean for simple stuff, that doesn't need the overhead of an Application server.
But you use an EJB, when you really want to use the benefits of an App Server, like Transactions, JDBC, Security, and just well optimized Server for that stuff.
Mark
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like Mark mentionned, Javabeans and EJBs are a whole different ballgame. You will rarely use EJBs if you DO NOT need a huge system which needs transaction support, bean pooling, increased security etc. Javabeans are only serialized objects which have accessor methods (getters and setters).
If you are thinking in small terms (ex: website which does not need loads of concurrent users), go with an MVC model with JSP, servlets and JDBC.
If you need an enterprise application with thousands of users, security, transaction management, etc..), use EJBs (however use them wisely, read Core J2EE design patterns for the best practices), get a good application server (weblogic and websphere are both excellent, cannot forget JBoss either), and give yourself time because there is a large enough learning curve for EJB (version 2.0 now includes message driven beans, larger deployment descriptors, etc). Hope this gives you a little more insight
 
Bring out your dead! Or a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic