Analysis of the difference between bean and EJB in Java

Java beans are reusable components. There is no strict specification for Java beans. Theoretically, any Java class can be a bean. But usually, Because Java beans are created by containers (such as Tomcat), so Java beans should have a parameterless constructor. In addition, Java beans usually implement the serializable interface to realize the persistence of beans. Java beans are actually equivalent to the local in-process COM components in microsoft com model, which cannot be accessed by cross processes. Enterprise Java beans are equivalent to DCOM, that is, distributed components. They are Java based remote components Process method invocation (RMI) technology, so EJBs can be accessed remotely (cross process, cross computer). But EJBs must be deployed in containers such as webspere and Weblogic. EJB customers never directly access the real EJB components, but through their container. EJB container is the proxy of EJB components, and EJB components are created and managed by the container. Customers access the real EJB components through the container.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>