12 Replies Latest reply on Aug 17, 2009 2:58 PM by developer80

    Why using spring with seam

    developer80

      can you tell me please what's the advantage to use spring with jboss seam, I'm newest in seam and i have until now create a maven project with jboss seam(EJB3 and JSF) and i hope to integrate seam under my project but i dont know what's the benefit to do this,so i hope that you understand me and i'm waiting for your help :)


      All regards

        • 1. Re: Why using spring with seam
          lvdberg

          Hi,


          Is a bit of a tricky question. If you have a large installed base and/or you have a lot of specific components, re-usage, can save you of a lot of development-time. Another possibility is that you feel completely comfortable with Spring and you want to gradually migrate to Spring.


          If you're new to Spring; skip it and directly use Seam 

          • 2. Re: Why using spring with seam
            developer80

            Thank you for your quickly response, but what i should know the advantages for integrate spring in my project, that mean what spring bring me as benefits that do not exist in seam


            I think spring integration will not take much time


            All regards

            • 3. Re: Why using spring with seam
              lvdberg

              There are some advantages, and - if I recall well - a number of previous topics describes them. I can't decide for you if you should integrate Spring or not. That highly depends on your application (-requirements). As stated before, if you have a large installed base you can re-use these components, if you just started without previous Spring-experience, you should only use Seam and only go for Spring integration if you want something special.


              I can name a few cases where I liked to have the Spring possibilities, but - to be honesst - Seam provides the stuff I need. Some things I used in both Seam and Spring and which I like just a litlle bit more in Spring:


              - JMS integration (you can use whatever bean you want as MessageListener)
              - JMX integration (does the job automatically)
              - JasperReport integration,
              - splitting configuration files in separate files,
              -  Hibernate Templating


              Things which can be done with some small additional effort in Seam.


              I find that that Seam outruns Spring in the area of wrapping a number of basic standards software modules.  
              - JAAS based Authentication/Authorisation is a piece of cake,
              - REST -web services has an incredible high WOW level,
              - The Query-component provides you with all the paging stuff you need (make a simple datatable with Rich-faces and find out for yourself),
              - Simple PDF and especially in combination with email is great,
              - Workflow integration is really good,
              - etc. etc.


              However, focus on your requirements and the available duration of your project.


              • 4. Re: Why using spring with seam
                christian.bauer

                Leo van den Berg wrote on Aug 17, 2009 12:20:


                - splitting configuration files in separate files,



                You can put as many .components.xml files anywhere in your classpath as you want and they are loaded and merged with all other configuration metadata automatically. This is documented in the reference.


                (Do NOT use or recommend the Hibernate or JPA template stuff! You can find many old debates about why it's an API lock-in with no advantages for users.)

                • 5. Re: Why using spring with seam
                  lvdberg

                  Totally agree, but the question is why you should integrate Seam with Spring. The components files are better manageable in Spring by using the includes.
                  My reply is basically that you should re-re-re-think it a number of times first and look at the requirements and the installed base . Not just because it's cool to do it...


                  P.S. Sorry for the templating remark, 



                   

                  • 6. Re: Why using spring with seam
                    christian.bauer

                    Leo van den Berg wrote on Aug 17, 2009 12:49:


                    The components files are better manageable in Spring by using the includes.



                    Uhm, why is it easier to list the includes manually rather than detecting them automatically? That is AFAIK what you have to do in regular Spring XML configuration.


                    That was actually a major headache in many old and large Hibernate projects, when different teams had to synchronize their changes to the list of included mapping files in one hibernate.cfg.xml. Autodetection with a naming convention solves that problem.



                    • 7. Re: Why using spring with seam
                      lvdberg

                      We have a very large installed base with configuration files describing its content (something like: DomainModelPersistencyMapping.xml or ContactReporting.xml) each file contains the beans which make up that specific module. The root configuration defines all the sub-modules, so from a maintence point of view in our pre-Seam time (not so very long ago) we (and I think a lot of other developers) choose to do it this way.


                          

                      • 8. Re: Why using spring with seam
                        christian.bauer

                        I still don't understand why that is easier than putting a Foo.components.xml into each module package that needs configuration XML metadata, and having it automatically found if that package happens to be on the classpath :)


                        • 9. Re: Why using spring with seam
                          developer80

                          After reading some topics for integration Spring with Seam ,I saw that The @Transactional annotation is more robust in Spring than Seam,someone have idea about this??

                          • 10. Re: Why using spring with seam
                            lvdberg

                            Because I wouldn't have to change names or make (another) new configuration file.  I am over 50, and really lazy when it comes to re-re-re-configurations.  


                            • 11. Re: Why using spring with seam
                              lvdberg

                              Can you define robust a bit more, I really would keep away of mixing Spring/Seam persistency, that was alreeady mentioned by Christian.


                              • 12. Re: Why using spring with seam
                                developer80

                                That what i have seen in all the topics,but i did not understand what is the difference of use,and what about the others benefits of integration spring,Christian have you any idea??