我应该将EJB3或Spring用于我的业务层吗? [英] Should I use EJB3 or Spring for my business layer?

查看:98
本文介绍了我应该将EJB3或Spring用于我的业务层吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队正在开发一个带有Web前端的面向服务的新产品。在讨论我们将使用什么技术时,我们决定运行JBoss应用服务器和Flex前端(可能使用Adobe AIR进行桌面部署),以及用于连接客户端和服务器的Web服务。

My team is developing a new service oriented product with a web front-end. In discussions about what technologies we will use we have settled on running a JBoss application server, and Flex frontend (with possible desktop deployment using Adobe AIR), and web services to interface the client and server.

当涉及到我们的业务逻辑使用哪种服务器技术时,我们陷入了僵局。最重要的论点是EJB3和Spring之间,我们最关心的是可扩展性和性能,以及代码库的可维护性。

We've reached an impasse when it comes to which server technology to use for our business logic. The big argument is between EJB3 and Spring, with our biggest concerns being scalability and performance, and also maintainability of the code base.

以下是我的问题:


  1. 对于EJB3和Spring有什么争论?


    • 我可以期待哪些陷阱?

    • 我在哪里可以找到好的基准信息?


推荐答案

EJB3与之间没有太大区别Spring基于Performance。我们之所以选择Spring是出于以下原因(问题中未提及):

There won't be much difference between EJB3 and Spring based on Performance. We chose Spring for the following reasons (not mentioned in the question):


  • Spring推动架构朝着更容易支持单元测试的方向发展。例如,注入一个模拟DAO对象来对您的业务层进行单元测试,或者利用Spring的MockHttpRequest对象对servlet进行单元测试。我们为单元测试维护一个单独的Spring配置,允许我们将测试与特定层隔离。

  • 最重要的驱动程序是兼容性。如果你需要支持多个App Server(或者最终希望选择从JBoss转移到Glassfish等),你将基本上随身携带你的容器(Spring),而不是依赖于不同实现之间的兼容性。 EJB3规范。

  • Spring允许为持久性,对象远程处理等提供技术选择。例如,我们也使用Flex前端,并使用Hessian协议进行Flex和春天。

这篇关于我应该将EJB3或Spring用于我的业务层吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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