【text】
Data communication is the application field that is currently very active and popular computer and information technology. A large communication company has developed its main support platform, here, we are referred to as "Communication Information Service Platform" for carrying out data business in the country and globally. This platform is a typical Java technology applied to an INTERNET project.
As a technical backbone in the information technology company, I have been fortunate to participate in the analysis and design of the system, and I have a considerable Java application development task. Most of the software part in this system is implemented by Java. In all systems, we use the Java architecture system:
(1) The system can be divided into 4 layers, which is Browser, representing a layer, an intermediate layer, and a data layer.
(2) Indicates the Java Script in Java to implement the page output in Java Script.
(3) The middleware layer uses Java to implement CORBA, which is implemented, which is mainly implemented and reused for business logic.
(4) The data layer is mainly the implementation of the database and stored procedures.
When we apply Java technology, the techniques and strategies used can be generally summarized as the following five aspects:
(1) Make Java Script as simple as possible, because Java Script is placed in the server side in our system, which is performed by an interpreter, relatively slow, we use two HP front machines Run Java Script, but its running speed is still not ideal, so we use the Java Script only to display the data obtained from the middleware layer to generate a dynamic page. In the initial design, a layer (Java Script) has undertaken some business logic processing operations, resulting in efficiency, so we have to reduce the amount of Java Script.
(2) When implementing CORBA with Java, sharing and multiplexing should be considered. In this system, the initial design is to make Java when implementing Component, just performing some of the operations of the database table, resulting in a large load of the layer. Later, when we were redesigned, summarize all USE CASE, identify the interfaces that can share and reuse them, and package the same business logic to a interface. Because Java's execution efficiency is higher than Java Script, system efficiency is improved.
(3) In other projects, we have used JSP technology and servlet technology in Java, and the average person may not distinguish between two Java technology. In order to obtain some of the execution rate of the system, we adopted a famous pressure test software - Load Runner to test the difference in these two technologies. Test indicates that the same operation is done with JSP and servlet, and guarantees that the test data obtained in the same test environment (the same server, pressure test workstation and database environment), the test data has a big difference, JSP completes an average of an operation The execution time will eventually be twice as the servlet program. In an enterprise application project, this may be a very critical bottleneck. Therefore, we have concluded that use the servlet as much as possible under possible conditions. Of course, JSP programming is fast and modified compared to servlet, and it is acceptable to applications where access is not very large.
(4) When using Java as an overall solution, try to use the same version of JDK as much as possible. In projects with Java as programming languages, almost mostly encountered "Chinese characters" problem, Java is likely to have garbled when there is no transition. With different versions of JDK, the solution solution is different, such as the V1.2.2 version of JDK and V1.3 version of JDK solutions will be different, put the java program of V1.2.2 in V1.3 In the JDK, the Chinese characters cannot be output smoothly. The root cause is that Java uses Unicode encoding and is different from our national standard coding. Therefore, some people struggled to advocate "one writing, everywhere" seems to be unable to pass all occasions. (5) When using Java, the software specification should be as follows. There is a concept of JVM in Java, that is, a garbage collector is used in the Java virtual machine, specifically used to recycle memory. But the garbage collector also brought hidden dangers while bringing convenience to programmers. In the programming, the garbage collector cannot be enforced, so developers cannot determine if an object has been released, often let programmers develop bad habits that are automatically collected, so we request: After try, Catch must be clearly required Recycling memory (of course, can only be notified of garbage collector to recycle garbage), which effectively improves system stability.
The technical and strategies of these practical properties are some practical experiences in practice, only for developers based on actual conditions.
Of course, when using Java as a solution, there will be a lot of problems that make us headache. These problems have caused concurrent concurrency and the system speed is slow. In summary, the main specific issues we have encountered are:
(1) Use Java to implement Component in CORBA, and sometimes the efficiency will be relatively low.
(2) Establishing a database connection with Java is often slower.
(3) It is easy to lead to the spread of system information when programming with JSP. For example, if there is a hacker attack a server running a JSP program, he can deliberately enter some illegal characters or exception information to the JSP program, so the program execution will appear. At this time, the corresponding error message will be printed on the page. Unfortunately, this information is very likely to expose the version number and path information of the JDK of the server. This is often easy for hackers to organically multiply, and it is possible to seize the loophole of the system.
After discovering these problems, we have carefully studied some solutions. such as:
(1) Since it is relatively slow to implement Component with Java, we try to reduce the amount of business logic executed by Component. Strive for the operation that can be implemented in the stored procedure and implement it as much as possible during the stored procedure. It is well known that the stored procedure operation of the database is much faster than executing database operations in the Java program.
(2) Since it is slow to establish a database connection with Java, we can encapsulate the database connection into a connecting pool, so that system efficiency can be greatly effectively improved. We have also used "Load Runner" for pressure testing, using the connection pool than the speed of the connection pool is 3 to 5 times faster.
(3) In order to deal with the JSP program and the servlet program print out the problem of exception system information. We have annealed a lot of JSP or servlet, eventually no hair. But we can change another idea, that is, do not start from the program, and start from the web server, we can configure the Apache to make such exception information no longer print, but make it only a universal unusual description This problem can be solved very effectively. Most of them are successful in so many projects we use Java as programming languages. As a fast, stable computer language, it is quite stable and compared to developing Internet applications.
In my personal opinion, Java's application prospects are very bright, which can generally focus on the following:
(1) There will be a wider application on the Internet.
(2) In the embedded device, Java is also useful in Wudi. For example, in the latest Java technology, Java has entered the mobile phone field.
(3) Most of the Java program runs with threads, accounting for less resources, will gradually replace ASP and CGI programs. According to third parties, it indicates that the JSP program is more than 2 times faster than the ASP program. Use JSP instead of ASP should be a general trend.
(4) The application in Java in the wireless Internet will be more extensive. Java supports WAP, which can easily develop WAP programs in Java, implement WAP applications.
(5) The seamless connection of Java and XML makes Java have a great advantage in data transfer and heterogeneous network communications.
In someone in person, I will work on the application of Java in the wireless interconnection in a quite period of time, and have developed more excellent practical items for my country's mobile communications..
Comment; have practical experience after participating in a large project. The full text has been used in 1, 2, 3, 4, and the style of the article is monotonous, and it is not very attractive. However, the advantages of this article are; (1) It is very organized. (2) Selection of content is appropriate. (3) The strategy listed, the concerns and discovery issues are realistic. (This article mainly refers to Guangzhou Wang Haibo et al. "