Talk about EJB efficiency problem

zhaozj2021-02-17  56

It is often seen that there is a problem on the Issue on EJB efficiency. The most common is to replace the Entity Bean efficiency and use Stateless Session beans. Let's analyze this issue. First, a large reason for the low efficiency is to call through RMI. RMI is a Java remote method call technology. It is necessary to pass TCP / IP, which is more slower than the overhead called by local function (the latest EJB specification proposes Local Interface Concept is used to make up this lack). Of course, there is a more important reason for the efficiency of Entity Bean, which is due to the structure of the Entity Bean. Since each finding a row of data is used to perform two database operations using the Entity Bean (once is identified by the primary key, the other is to find the data through the primary key), thus making the efficiency of database access. Therefore, some people propose to use the Stateless Session Bean to access the database instead of entity beans. In this view, I think it is a bit of formalism, for EJB and EJB. EJB is an architecture that follows OO's design mode to quickly develop distributed, structural flexible, easy to change and expand business logic enterprise-class applications, while sacrificing execution efficiency is at its expense. When developing a technique selection, you should not first use EJB JSP and then choose in the Stateless Session Bean and the Entity Bean, but you need to analyze the system if you really need to use EJB. As mentioned above, if it is an enterprise-level application application system that develops demand, Application EJB technology will greatly simplify the development and maintenance cost of the system; if the system needs to have higher execution efficiency, JSP JavaBean may be more Suitable choice. In short, no matter what technology, it is not because advanced will be used, but it should be an advantage to exploit the technology. This technology is not suitable for development systems, so that it can really play the advantage of technology.

Huang Kai

转载请注明原文地址:https://www.9cbs.com/read-29248.html

New Post(0)