7 Replies Latest reply on Dec 22, 2010 11:41 PM by nitingaur.nitin.gaur.keane.com

    Seam POJO vs Seam EJB3

    sait

      Hi Everyone,


      What are advantages or disadvantages using Seam EJB3 instead of Seam POJO? Or using Seam POJO is a much better solution? Has anyone migrated a project from Seam POJO to Seam EJB3 or EJB3 to POJO ?



      Mustafa Sait ÖZEN

        • 1. Re: Seam POJO vs Seam EJB3
          • 2. Re: Seam POJO vs Seam EJB3
            sait

            thanx

            • 3. Re: Seam POJO vs Seam EJB3
              asookazian

              Don't listen to Francisco, he's biased as he was on the EJB3 expert group.  :)


              Main problem with EJB3 components is that you can't incrementally hot deploy them (kills productivity).  But you do get free EJB container services like interceptors, timers, pooling, transactions, thread-safety, passivation/activation of SFSBs, etc.  In many cases, Seam offers alternatives for these services.


              Main problem with JavaBean components is that most likely you will use Seam CMT (@Transactional) which does not support enough TransactionPropagationTypes that Spring or EJB CMT do support.  https://jira.jboss.org/jira/browse/JBSEAM-4391


              I would recommend not using EJB (as much of a fan of EJB 3 that I am) b/c of the productivity hit for lack of hot deployment.  You could always upgrade your WAR to an EAR as it's just a couple annotations to convert a JavaBean to a EJB (well, and a @Remove method for SFSB and a local interface but that's going away in EJB 3.1!)


              Adam Bien, a Java Rock Star, is a big proponent for using EJB in distributed JEE computing...

              • 4. Re: Seam POJO vs Seam EJB3

                Arbi Sookazian wrote on Sep 29, 2009 17:47:


                Don't listen to Francisco, he's biased as he was on the EJB3 expert group.  :)



                ROFLOL!

                • 5. Re: Seam POJO vs Seam EJB3
                  sait

                  Thanks, Arbi and Francisco. @Transactional operation matters but can you have any ideas about performance issues? POJO is simple and faster?

                  • 6. Re: Seam POJO vs Seam EJB3

                    Yes, POJO is simpler and faster, and the level of transactional support (and other services) provided by EJBs is needed only 0.01% of the times (in my experience)

                    • 7. Re: Seam POJO vs Seam EJB3
                      nitingaur.nitin.gaur.keane.com

                      Went through the posts in this and other thread of EJB3vsPOJO, Thanks a lot guys.


                      Is it good strategy to build the project as EAR project but use only POJO until you really don't need EJB so leverage hot deployment of POJO while still packaging then in EAR instead of WAR?


                      If we start with WAR packaging and later EJB are required, what could be problem converting that into an EAR packaging?


                      What could the scenario in which EJB can be required in future? (other than distributed deployment)


                      Thanks in advance.