Last night I attended a New England Java User
Group (NEJUG) meeting where Reza Rahman presented a "comparative
analysis" of EJB 3 and Spring. Reza is one of the authors of EJB 3 in
Action. I enjoyed meeting Reza and respect him for presenting what may
be considered a controversial topic.
I will provide brief responses to 10 "themes" of the presentation.
1. EJB uses annotations for metadata. Spring uses XML.
2. Spring allows you to support multiple deployment environments but requires more configuration.
3. EJB with JPA, Spring with Hibernate
4. Spring makes no assumptions, you have to provide configuration.
5. Spring does not have a stateful application paradigm.
6. Spring requires configuration of a container per MessageListener.
7. Concurrent Consumers cannot be greater than 1.
8. Spring's usage of the AspectJ expression language is powerful but cryptic.
9. Spring tool support has been sparse.
10. With EJB as a standard, you can migrate from one vendor to another. With Spring, you still have to port the metadata.
来自 “ ITPUB博客 ” ，链接：http://blog.itpub.net/374552/viewspace-579/，如需转载，请注明出处，否则将追究法律责任。