Announcement Announcement Module
Collapse
No announcement yet.
Spring vs. Seam Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring vs. Seam

    Hi,
    This is a question that has been discussed before, but I would like to hear some more recent comments.

    Starting a new large scale service project the question from my managment is being asked whether to build it on Spring or on Seam.

    Of course Spring and Seam are not the same, especially when you look at the ecosystem around both products, but the answer I'm looking for is:

    How does Spring position itself as a competitor with Seam?

    Does it really come down to choose EJB over Ioc?

    I think a fundamental difference between Spring and SEAM is around the integration of other technologies: Spring is a very open and extensible architecture while Seam is a technology which tightly integrates with other technologies that come from the RedHat/JBoss world. For example using Seam you commit to Enterprise Java Beans 3.0 as the component architecture and using an EJB container (i.e JBoss) to run in.

    As I see in Spring these are choices using not requirements. At the core of the spring framework ist the IoC container which has been designed as a lightweight alternative to EJB.

    I have been working on a Spring based webservice project for about a year but I have not worked with SEAM.

    Thank you for commenting on this, or pointing me to other fundamental differences.

  • #2
    Hello,

    We're currently using both frameworks in the same application (rather unusual) - but not in production for the moment.

    Seam is rather really really fine if you want to use Jsf and Jpa.
    If your application is mainly targeted for those two technologies (or even wicket - Seam 2.1 is now integrated with wicket), I would say just use Seam and not Spring - Seam is largely better integrated with those technologies (and of course use facelets and icefaces or richfaces).

    We chose Spring because we were not interested by using massively Jpa (we prefer plain old Jdbc - rather simpler for us). So we like Spring goodies such as the templates (I know we could have rewritten this part - but why bother ? Spring makes it better than us !)
    We also like Spring Batch.
    We also want a platform with a backbone we can use for Struts based applications or Jsf based ones.
    So, all these requirements points us to using Spring.

    About the integration Seam / Spring are rather really well integrated.
    Our main concern has been primarily about security (we created a bridge between Seam and Spring Security). But you won't need it if you choose to use Seam Security and drop Spring Security.

    I'm not saying that if you use Seam you *must* use Spring.
    Just look at Seam documentation to make a clear idea of the functionnalities in Seam and if it covers 90% of your needs, use Seam without Spring.
    Same thing, if you want to code fast, just use Seam without Spring (and avoid service / daos) - but you'll have surely some difficulties if your application code base is big.

    If you don't want to use Jsf or Jpa (and don't want to use any other component base framework), I would say stay out of Seam.

    Our architecture is :
    Jsf Page / Seam Action / Spring Manager / Spring Dao.
    And no transfer Objects !

    About Seam / Spring integration : http://docs.jboss.com/seam/2.0.2.SP1...ml/spring.html

    Comment


    • #3
      Some more information, we had a very long learning curve, mostly because of the complexity of the followgin frameworks (from most complex to lowest) :
      - Jsf
      - Jpa
      - Seam

      Spring was really 'piece of cake'.

      Seam (and Jsf for this matter) is really fine if you just stay on classic use cases (those generated with seam-gen for instance).
      If you want more, you have to struggle to understand how Jsf and Seam works.

      Jpa : we're currently staying out of it (we would have the same conclusion with using Hibernate for the matter) - too much framework there.

      Good luck !

      Comment


      • #4
        Thanks for your comments.

        Comment


        • #5
          I have been using Seam since 1.2.1.GA. There is a very big learning curve with JSF/facelets/Richfaces/EJB3/Hibernate/Seam if you haven't used any of these technologies before. Read Seam in Action.

          Originally posted by couzteau View Post
          How does Spring position itself as a competitor with Seam?
          SpringSource and Redhat/JBoss are direct competitors. You can integrate SpringBeans in Seam apps.

          Originally posted by couzteau View Post
          Does it really come down to choose EJB over Ioc?
          It comes down to stateful vs. stateless context management. Seam also adds business process context (in addition to the standard request, session, application contexts). Seam uses interceptors (as does EJB 3 and Hibernate) which are simple versions of AOP. There's a whole lot of functionality that Seam adds like identity management with 2.1.0.GA and remoting, conversational web services, seam-gen a project skeleton, etc. Very powerful framework. The goal of Seam is to extend and unify JSF & EJB3 and is now the basis for Web Beans (JSR 299) which is slated to be included in Java EE 6.

          Big difference b/n Seam and Spring: Seam has very little XML config (there are literally a handful of XML files to configure) and Spring uses AOP extensively while Seam does not.

          Originally posted by couzteau View Post
          For example using Seam you commit to Enterprise Java Beans 3.0 as the component architecture and using an EJB container (i.e JBoss) to run in.
          EJB 3 components are optional in Seam. You can use JavaBean classes (POJOs) if you want as your backing beans.

          Comment


          • #6
            Originally posted by rabies View Post
            EJB 3 components are optional in Seam. You can use JavaBean classes (POJOs) if you want as your backing beans.
            That's correct. I'm not sure how the rumor got started that Seam requires EJB or even JBoss app server for that matter. I work on a Seam app (JSF) which just uses pojos and runs great under Tomcat.

            Comment


            • #7
              Originally posted by mmichalek View Post
              That's correct. I'm not sure how the rumor got started that Seam requires EJB or even JBoss app server for that matter. I work on a Seam app (JSF) which just uses pojos and runs great under Tomcat.
              Out of curiousity, when deploying under Tomcat doesn't it need a Embedded JBoss to run the application using JBoss Seam? Or is that purely used when developing with EJBs?


              Shah.

              Comment


              • #8
                Originally posted by shahnawazshahin View Post
                Out of curiousity, when deploying under Tomcat doesn't it need a Embedded JBoss to run the application using JBoss Seam? Or is that purely used when developing with EJBs?
                You only need JBoss embedded for EJB or other container managed stuff outside of the servlet container. We run our Seam app under plain Tomcat 6 (not using EJB, etc.).

                Comment


                • #9
                  Given the following constraints, what is recommended?

                  1. Integration with Workflow (JBPM)
                  2. Integration with Reporting (Pentaho or JasperReports)
                  3. To the extent possible, ability to export to MS-Word, Excel and PDF formats


                  Seam seemed like the obvious choice due to JBPM?

                  Comment


                  • #10
                    Originally posted by embaye View Post
                    Given the following constraints, what is recommended?

                    1. Integration with Workflow (JBPM)
                    2. Integration with Reporting (Pentaho or JasperReports)
                    3. To the extent possible, ability to export to MS-Word, Excel and PDF formats


                    Seam seemed like the obvious choice due to JBPM?
                    Seam supports jBPM integration (see the online Seam in Action chapter here: http://manning.com/dallen/SeamIACH14_bonus.pdf) as well as Excel/PDF support in Seam 2.1.

                    check out these links:

                    IText:
                    http://docs.jboss.com/seam/2.1.1.GA/..._single/#itext

                    Excel:
                    http://docs.jboss.com/seam/2.1.1.GA/..._single/#excel

                    jBPM:
                    http://docs.jboss.com/seam/2.1.1.GA/...l_single/#todo
                    http://docs.jboss.com/seam/2.1.1.GA/...ngle/#dvdstore

                    Post add'l questions here: www.seamframework.org

                    And watch out for Christian Bauer, he bites...

                    As far as reporting integration, not sure, haven't heard of any. Pentaho sucks, we evaluated and went with Oracle BI tools.

                    Also, consider the fact that JBoss AS 5 supports Ruby on Rails app deployments as well (pretty neat!)

                    http://java.dzone.com/articles/odd-t...terview-with-b

                    Comment


                    • #11
                      I have not used Seam yet, and only a few spring libraries - core spring with IoC, Spring AOP, Spring Security, now starting with Spring dynamic modules (OSGi integration), and Apache CXF for web services integrates with Spring very well.

                      Having XML configuration files is not a downside at all if you have good navigation support in your IDE - eclipse/intellij, otherwise its a nightmare.

                      It's my personal opinion but I like the way things are done in Spring. The more I use it the more I like it .

                      Comment


                      • #12
                        Originally posted by jaro View Post
                        I have not used Seam yet, and only a few spring libraries - core spring with IoC, Spring AOP, Spring Security, now starting with Spring dynamic modules (OSGi integration), and Apache CXF for web services integrates with Spring very well.

                        Having XML configuration files is not a downside at all if you have good navigation support in your IDE - eclipse/intellij, otherwise its a nightmare.

                        It's my personal opinion but I like the way things are done in Spring. The more I use it the more I like it .
                        annotations are now available in Spring as well... no more XML hell (if you so choose)

                        Comment


                        • #13
                          Thanks rabies. For our web application where for now we are looking for a facilitated integration with a workflow tool (plus Reporting tools and MS-Office) and judging from the examples given in Seam in Action and the Seam tutorials, it looks like Seam would be the faster way to build. However, further downstream, there will be requirements for integration with tools that I am not familiar with like a portal (Life Ray) and a document management system (like Alfresco) and JSF might help with that. Still something is pulling me towards Spring ... I guess I better experiment ... but for now the only workflow tool I have is JBPM which requires an application server ...
                          Thanks again ...
                          Last edited by embaye; Feb 3rd, 2009, 11:04 PM.

                          Comment


                          • #14
                            Seam-Spring integration

                            This may be helpful: http://www.javaworld.com/javaworld/j...ring-seam.html

                            Spring forums are great
                            Last edited by joblini; Feb 22nd, 2009, 09:37 PM.

                            Comment

                            Working...
                            X