• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

When to use Java Beans and when EJB

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic