Side-by-Side Comparison of Spring and EJB 3.0
2006-09-08 11:49
417 查看
devx has posted the first of a two-part series on a side-by-side comparison of spring and ejb 3.0, attempting to clarify what each of them is, and the article also tries to reevaluate how well ejb 3.0 has addressed the shortcomings of previous versi and determine what spring has to offer above and bey ejb3.
the article starts off by comparing spring + hibernate and the java persistence architecture. c that hibernate 3 is a compliant implementation of jpa, it's not surprising that the two are roughly equivalent; no direct comparison against spring's other persistence mechanisms (jdbc, ibatis, etc) is suggested, although jdo, ibatis, and jdbc support in spring is mentioned.
declarative transaction management is menti next; the interesting point here is that identical code is used for spring and ejb3 here. ejb3 uses the c transaction support for ejb3 method calls, whereas spring uses its transacti aspect. one advantage of spring here is that multiple transaction types are supported, whereas ejb3 supports jta transactions.
statefulness is the next item for consideration. stateful beans are supported in ejb3 via stateful session beans; state is supported in spring through the use of prototypes. the article states that spring is primarily a framework emphasizing statelessness so there are some issues to c when using a stateful element; note that this doesn't prevent stateful objects in spring.
as the author concludes:
if you are working with applicati that are highly stateful then you may want to c whether ejb 3.0 sfsbs might be a good solution. for highly c applicati you may want to c seam, which provides a very powerful solution for c interaction built on sfsbs and jsf.
spring gives you more flexibility in many aspects of application development than ejb does—and as you've seen in this article, this is particularly true with regards to persistence and transaction providers. but the trade-off for this added flexibility is increased complexity in configuration. ejb 3.0 provides less flexibility but its tight technology stack, annotati c and philosophy of c by exception make c ejb 3.0 applicati quite simple. if flexibility is more important to you than a pre-defined approach then you certainly will want to c spring.
a final point on standardizati while spring integrates many standards such as jta, jdbc, and jms it is not itself a java standard. if standardization (and by extension vendor support, tooling, etc.) is important to your organization or application then you will want to c ejb 3.0.
but luckily spring and ejb 3.0 are not mutually exclusive choices. there are very powerful ways of integrating these two technologies to take advantage of their relative strengths and weaknesses.
the article starts off by comparing spring + hibernate and the java persistence architecture. c that hibernate 3 is a compliant implementation of jpa, it's not surprising that the two are roughly equivalent; no direct comparison against spring's other persistence mechanisms (jdbc, ibatis, etc) is suggested, although jdo, ibatis, and jdbc support in spring is mentioned.
declarative transaction management is menti next; the interesting point here is that identical code is used for spring and ejb3 here. ejb3 uses the c transaction support for ejb3 method calls, whereas spring uses its transacti aspect. one advantage of spring here is that multiple transaction types are supported, whereas ejb3 supports jta transactions.
statefulness is the next item for consideration. stateful beans are supported in ejb3 via stateful session beans; state is supported in spring through the use of prototypes. the article states that spring is primarily a framework emphasizing statelessness so there are some issues to c when using a stateful element; note that this doesn't prevent stateful objects in spring.
as the author concludes:
if you are working with applicati that are highly stateful then you may want to c whether ejb 3.0 sfsbs might be a good solution. for highly c applicati you may want to c seam, which provides a very powerful solution for c interaction built on sfsbs and jsf.
spring gives you more flexibility in many aspects of application development than ejb does—and as you've seen in this article, this is particularly true with regards to persistence and transaction providers. but the trade-off for this added flexibility is increased complexity in configuration. ejb 3.0 provides less flexibility but its tight technology stack, annotati c and philosophy of c by exception make c ejb 3.0 applicati quite simple. if flexibility is more important to you than a pre-defined approach then you certainly will want to c spring.
a final point on standardizati while spring integrates many standards such as jta, jdbc, and jms it is not itself a java standard. if standardization (and by extension vendor support, tooling, etc.) is important to your organization or application then you will want to c ejb 3.0.
but luckily spring and ejb 3.0 are not mutually exclusive choices. there are very powerful ways of integrating these two technologies to take advantage of their relative strengths and weaknesses.
相关文章推荐
- How-To : Using EJB 3.0 and Java Persistence API with Spring in OC4J
- A Comparison of Spring MVC and JAX-RS
- A Technical Comparison of TTLS and PEAP
- Clustering by fast search and find of density peaks 论文中文翻译及matlab实现
- Get the average socre of the student.(The exmaple of group, having and order by).求学生平均分(group, having 和 order by使用示例).
- RFID Exploration and Spoofer a bipolar transistor, a pair of FETs, and a rectifying full-bridge followed by a loading FET
- The Development and Comparison of Robust Methods for Estimating the Fundamental Matrix
- 机器学习 - Clustering by fast search and find of density peaks
- [mysql] Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'lo
- A Comparison Of NoSQL Database Management Systems And Models
- jdbc4.MySQLSyntaxErrorException:Expression #2 of SELECT list is not in GROUP BY clause and contains
- Learn Features of Spring 3.0
- Spring Vs. EJB 3.0
- Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'userinfo.
- Comparison of Java and C++
- Step by Step Installation of the Subversion 1.x Server for Linux and Solaris 8/9/10 (English)
- There will be decreasing performance of oracle by delete whole table and then insert ...
- SQL---Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column '
- Drug side effect extraction from clinical narratives of psychiatry and psychology patients
- Science14年的聚类论文——Clustering by fast search and find of density peaks