Some suggestions for J2EE application deployment (2)

zhaozj2021-02-16  60

Originally from www.onjava.com

http://www.onjava.com/pub/a/onjava/2003/06/11/j2ee_deployment.html?page=1

Join the previous one

It is usually considered that Remote Calls needs more time than Local Calls. In remote process calls, local agent objects must be copy all parameters and transfer them through cables, through RMI, when remote control objects, will cause network traffic blockage And long response waiting

Considering the details of the user issuing a command on the web page, the special request turns call servlet, which is processed in the Business Method in Session Beans and Entity Beans. At least 4 network operations have simultaneous operation, two of which are Remote EJB Calls. Figure

When Session Beanscall, other session beans or multiple Entity Beans, you need to create additional Remote Calls. If the effect is performed, first, it is necessary to make adjustments when the architecture and design are required. To reduce the number of REMOTE CALSS, and reduce the consumption generated by Remote Calls.

Here we have many ways to solve the PERFORAMCE problem. We can reduce the TRIPS on the network by using EJB's Coarse-grained design mode. We can eliminate unnecessary remote calls by using local rather than remote interfaces or entity Beans. By changing the packaging structure, more beans are deployed in an EAR file to make some remote calls into local calls.

2.1.2 Local Interface VS Remote Interface J2EE 1.3 The concept of local Enterprise Beans is introduced, which allows an Entity Beans to display local interfaces, which allows parameters to deliver parameters instead of passing value Value. However, in order to enable Session Beans to access local Enterprise Beans, local Enterprise Beans must be packaged in the same EAR file as the session bean. There are usually two ways to implement. a. In the data layer, you can create a session facade before entiy beans, which can also make the entity beans to the same role in internal Application, however, if only this session facade technology, the program runs Tender is not very good. B. Put Entity Beans in the Business Layer and allow the business layer of Session Beans to directly connect local Enterprise Beans. This reduces the degree of Entity Beans repeatedly. Since the local Entity Beans can only work in the same EAR file, other business beans in the module outside the Application cannot be connected to the Entity Beans. And this will double in the same Entity Beans in different ApplicatiPN modules (Instances)

2.1.3 Packaging Structure Some J2EE Application Server For example, WebLogic's WebLogic optimizes remote calls between BEASNs and local calls. If Beans are in the same Enterprise Application, this is a session beans or Entity Beans. But this also has some disadvantages: reducing maintainability: All BEANs that packages in the same EAR must be deployed or redeployed at the same time, which prevents the possibility of change Beans in runtime. Platform dependency: Not all app servers provide optimization of this way, and if you transform App Server Vendors, there is no effect. May be destroyed to design ideas: Many developer design beans assume that all parameters are passed through the pass value instead of passing the reference . Be sure to use the J2EE module that uses it. However, if you are in some cases, if you are used by several modules, you can get him in a place where these resources can be obtained. In addition, put the resource path into your system's classpath will cause conflicts with other J2EE modules to the same container. This will limit you to deploy J2EE applications.

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

New Post(0)