EJB 3的最佳功能 [英] Best features of EJB 3

查看:108
本文介绍了EJB 3的最佳功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

方案


  • 您已使用EJB版本3开发了一个webapp。

  • 系统部署,交付并由客户使用。

如果你必须从头开始重写系统,你会再次使用EJB吗? ?

If you would have to rewrite the system from scratch, would you use EJBs again?

:请勿回答此问题,请回答这一个

No: Don't answer this question, answer this one instead.

:提供根据您的个人经验,EJB解决了一个重要的实际问题。

Yes: Provide one important, real problem that EJBs solved, based on your personal experience.

让答案只包含一个问题。这将让其他读者投票支持EJB的最佳功能。

Let the answer contain just one problem. This will let other readers vote up the best feature of EJBs.

推荐答案

我认为这取决于你是什么版本的EJB谈论。让我们讨论仅有的两个相关(IMO)版本。

I think it depends on what version of EJBs you're talking about. Let's discuss the only two relevant (IMO) versions.

遗留系统中的某些人可能仍会使用EJB 2.1。它们真的最有用作RPC抽象。他们还提供了一个基本的ORM(对象 - 关系映射)系统。正如您所提到的,提供了事务支持。因此,如果您要构建一个您希望与远程系统通信的系统,传输面向对象的数据并以事务方式执行,您可能会发现EJB值得付出努力。否则,我会说远离。

EJB 2.1 might still be used by some people in a legacy system. They really have the most use as an RPC abstraction. They also provided a rudimentary ORM (Object-Relational Mapping) system as well. And as you mentioned, transaction support is provided. So if you were building a system where you wanted to communicate with a remote system, transfer object-oriented data and do it transactionally, you might find EJBs to be worth the effort. Otherwise, I'd say stay away.

然而,EJB 3.0已经有了很大的改进。它具有以前版本的所有功能,但是以更直接的方式实现。它还提供了一个相当简单的Inversion-Of-Control框架,与Spring不同,它是一个相当不错的ORM形式的JPA(Java Persistence API)。我使用过EJB 3.0并且实际上很喜欢它。您可以像使用Spring一样争论EJB 3.0的使用,此外它还有一些更高级或企业级的功能。

EJB 3.0, however, has been greatly improved. It has all the features of the previous version, but does it in a more straightforward way. It also provides a fairly simple Inversion-Of-Control framework not unlike Spring, and a pretty decent ORM in the form of the JPA (Java Persistence API.) I have used EJB 3.0 and actually enjoyed it. You could argue for the use of EJB 3.0 the same way you would for Spring, plus it has a few more advanced, or enterprise-y, features available.

这篇关于EJB 3的最佳功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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