EJB3或“Spring3 + hibernate”哪一个合适 [英] EJB3 or "Spring3 + hibernate" which one suitable

查看:95
本文介绍了EJB3或“Spring3 + hibernate”哪一个合适的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在EJB3和Spring 3中,有很多东西在使用hibernate时很常见。
我需要找出哪里可以使用Spring框架,而不使用EJB3,反之亦然。

如果你使用EJB3,你将不得不拥有一个完整的Java EE,EJB3应用服务器。 有些是免费的,有些则不是。

如果你使用Spring 3,你需要在你的CLASSPATH中有Spring JAR,但是完整的Java EE应用服务器不是需要。根据您的需要,Tomcat或Jetty已经足够。

EJB3实现有多个供应商;毕竟,EJB3只是一个规范。 Spring只有一个供应商。



就个人而言,我更喜欢Spring。自1.0版以来,我已经使用了六年,取得了巨大成功。这是一个非常高质量的框架。 EJB3从Spring和Hibernate学到的教训中吸取了很多。我认为Spring的面向方面的编程比添加到EJB3的编程更好。其他模块(例如安全,LDAP,Web服务等)非常好。

There are so many things are common in in EJB3 and Spring 3 with hibernate. I need to findout where I can use Spring framework with hibernate not EJB3 and viceversa.

解决方案

You can use them interchangeably.

If you go with EJB3, you'll have to have a full Java EE, EJB3 app server. Some are free, some are not.

If you go with Spring 3, you need to have the Spring JARs in your CLASSPATH, but a full Java EE app server is not required. Tomcat or Jetty are sufficient, depending on your needs.

There are multiple vendors for EJB3 implementations; after all, EJB3 is merely a specification. There's only one vendor for Spring.

Personally, I prefer Spring. I've used it for six years, since version 1.0, with great success. It's a very high quality framework. EJB3 took a great deal from the lessons learned by Spring and Hibernate. I think Spring's aspect-oriented programming is better than what has been added to EJB3. The other modules (e.g. security, LDAP, web services, etc.) are excellent.

这篇关于EJB3或“Spring3 + hibernate”哪一个合适的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆