Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
基本上我有2个问题。
我认为您的第二个问题回答了您的第一个问题。因为 JDK 支持基于接口的动态代理,所以为接口完整的 bean 实现容器要容易得多。然而,应用程序开发人员每次必须创建 bean 时都创建接口是很烦人的。这就是引入无接口 bean 的原因。然而,支持此类 bean 的容器的实现需要您提到的字节码工程技术,考虑到多类加载环境、动态重新部署和其他问题,这要困难得多。这可能是早期没有引入无接口 EJB 的原因。