EJB与执行相同功能的其他技术的主要区别是什么?

huangapple go评论61阅读模式
英文:

EJB Major Distinctions from other Technologies that perform the same function?

问题

一些EJB与执行相同功能的其他技术之间的主要区别是什么?为什么要如此关注这些技术,无论是支持还是不支持,而不是关注其他将“支持EJB”作为特性的系统呢?

英文:

What are some major distinctions between EJB and the other technologies that perform the same function, and why is there such focus on the technologies that are, or are not supported, as opposed to other systems that refer to things such as "supporting EJB" as a feature that is either there, nor not?

答案1

得分: 2

EJB的最初概念更接近于现在所称的微服务,其中各个组件可以部署在各种不同的服务器(EJB容器)上。

然而,现代微服务主要使用HTTP调用或消息队列,EJB的通信却是通过一种称为RMI的Java特定协议进行的,它使用Java序列化来在网络上透明地传输方法调用。这个网络中间件是需要接口的原因(在早期版本的EJB中,这甚至更加复杂!):在“本地”一侧,实际在接口后面的对象是一个代理,它将序列化您的方法调用并将其传输到EJB实现部署的任何位置。

Java EE(企业版)包括一系列功能,涵盖各种各样的“企业级”操作,包括事务、服务目录、持久化、Web(Servlets)和分布式方法调用。Tomcat指出,虽然它实现了Servlet API(Java EE的一部分),但它并未实现所有这些其他组件,如果您需要这些组件,您将需要另一个容器,比如GlassFish或WildFly。

英文:

The original concept of EJB was much closer to what are now called microservices, where the individual components could be deployed across a variety of different servers (EJB containers).

Whereas modern microservices mostly use HTTP calls or message queues, however, EJB communication happened over a Java-specific protocol called RMI, which uses Java serialization to route method calls across the network more or less transparently. This network intermediary is the reason for needing an interface (in earlier versions of EJB, it was even more complex!): On the "local" side, the object actually behind the interface is a proxy that will serialize your method call and transmit it to wherever the EJB implementation is deployed.

Java EE (Enterprise Edition) includes a collection of features that cover a wide variety of "enterprisey" operations, including transactions, service directories, persistence, Web (Servlets), and distributed method calls. Tomcat is calling out that while it implements the Servlet API, which is one part of Java EE, it doesn't implement all of these other components, and if you need them you'll need a different container, such as GlassFish or WildFly.

huangapple
  • 本文由 发表于 2020年10月19日 08:15:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/64419591.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定