tags:

views:

1937

answers:

4

What are the advantages/disadvantages of Seam over Spring? Why would I use Seam in lieu of Spring?

Is there anything that can be done in Seam that can't be done in Spring? Anything in Spring that can't be done in Seam?

What about stateful/stateless architecture? I am a Spring user, so I am biased, naturally.

+7  A: 

Why Spring?

* Cleaner code
* Streamlined application configuration
* Nice integration with popular open source products
* First class AOP support
* Enterprise-scale security: Acegi
* Highly flexible MVC
* Abstracted data access (JDBC is OK)
* Enterprise Java without EJB
* Testing is easy

Why Seam?

* Merge JEE 5 standards (EJB 3.0, JPA, JSF, Annotation) seamlessly
* Stateful by design
* Bijection
* Integrated Ajax (ICEfaces and Ajax4JSF)
* Business process integration (jBPM)
* Business rules integration (Drools)
* Workspace management
* Deliver complete stack (from JBoss & RedHat)
* Seam Text and EL enhancements
* Probably will be a standard (JSR-299: Web Beans)

From Framework Deathmatch: Spring vs Seam. Thomas Wiradikusuma (Spring). Joshua Jackson (Seam). Java User Group Indonesia. JaMU 07.03. March 17, 2007 power point presentation here

Soldier.moth
+1  A: 

Seam will give you a pretty, ah, seamless, integration between the components that make up the seam stack. All very nice as long you keep within that stack, and within the seam model and foing things. It all starts to look a little less convincing as soon as you start doing something unusual, though.

If it's not too much of a generalisation, Seam is very "microsofty" in that regard. This isn't a bad thing, it's just a stylistic thing. Spring is more open-ended and takes more effort to get going, but it's ultimately more flexible, and a lot more open.

skaffman
A: 

You can use Spring and Seam together - Spring for backend components, Seam for enhancement of web layer (JSF/GWT/Wicket) and other stuff. Seam offers a lot of Spring functionality (i.e. IoC container, transaction managment) - in your project you can decide - witch implementation to use. More details on integrating Seam with Spring - "Seam in Action - free bonus chapter"

cetnar
A: 

Let's compare the two.

What is common?

Both are open source, follow MVC architecture and has a servlet based front controller.

Advantages of Spring MVC

  • Extension of Struts.
  • View can be developed using JSP and HTML. You can also plugin other's like PHP or velocity.
  • Has large number of controllers predefined.
  • Integrated out of the box with Spring framework.

Advantages of Seam

  • Extension of JSF
  • View can be developed using JSF component library. There are large number of vendors to choose from.
  • Integrates JPA entities with Web layer
  • Annotation based validation
  • Integrates with EJB 3.0
  • Out the box jBPM support which provides process flow definitions.
  • Integrates with Drools where you can define web layer business rules.
  • Good community support.

Conclusion

Since Seam is built on JSF, it has large number of UI Component libraries to pick from. It reuses JEE stack better. It has lot of interesting modules integrated beforehand.

Spring MVC is built on top of Struts and Spring, so it will reuse Spring framework stack far better than others. But the view is built using JSP, so we have to rely on JSP tag library vendors to build rich components.

Seam framework would be a better choice as Spring framework is anyway extensible enough to be leveraged by Seam.

If you are not happy with either then visit my website http://ercilla.webs.com. It introduces an incredible UI Framework.

Ercilla Technologies