Java Business-to-business versus PHP

Source: Internet
Author: User
Java-to-business versus PHP-to-business comparison
I. Comparison of languages
PHP is the server scripting language that interprets execution, first PHP has a simple and easy-to-follow feature. Grammar and C language are more like, so learn C
Language programmers can quickly become familiar with the development of PHP. Java needs to learn Java grammar and familiar with some core class library, understand the surface
Design a method to the object's program. So Java is not as studious as PHP.
Java is first compiled into a bytecode. class file and then interpreted for execution on the Java virtual machine. Java Web Development is easiest to think about first
To the JSP (now to JSP2.0), the original Java Web development is implemented with Servlets, using servlets to develop the need
Programmers embed large amounts of HTML code in the source files of Java. So then came the jsp,jsp can be conveniently embedded into the HTML file when
, when the JSP file is executed on the server, it is first converted to a servlet by the application server and then compiled for execution. JSP can
Powerful functionality is generated through the support of Servlets and JavaBean. JavaBean is a reusable, cross-platform software component. Use
JavaBean can easily realize the separation of Java code and HTML, which can enhance the function of the system and the reusability of the software.
Java's web development is a specification of a sun company-defined EE. And it includes all aspects of Java's web development in the EE
, such as: JSP, Servlet, JDBC, JNDI, JAVABEAN, EJB, and so on. The Java EE is particularly well-suited for large enterprise applications.
Second, database access comparison
Java accesses the database through JDBC and provides easy access to the database through database drives provided by different database vendors. accessing data
The interface of the library is more uniform.
PHP has different database access interfaces for different databases, so the database access code is not very versatile. For example: With
Java-developed Web applications go from MySQL database to Oracle database with minimal modifications. and PHP needs to do a lot of modification work
For
Third, the system design architecture comparison
The use of Java Web Development technology requires an object-oriented approach to system design, while PHP is using process-oriented developers
Method. Therefore, it is necessary to do a lot of system analysis and design work in the early development of Java.
Iv. Cross-platform
Both Java and PHP have good cross-platform features. Can be run on Linux or Windows without making any changes
And so on different operating systems.
V. Development cost Comparison
PHP's most classic combination is: PHP + MySQL + Apache. Ideal for developing small to medium-sized Web applications with faster development
。 And all the software is open source free, can reduce investment.
Java's Web application server has free tomcat, JBoss, and so on, if the need for better commercialization of services are: Web Sphere and Web
Logic
Six, distributed multi-layer architecture comparison
PHP can only implement a simple distributed two-tier or three-tier architecture, and Java in this area is more powerful, you can implement multi-layer network rack
Frame. The database layer (persistence layer), the application (business) logic layer, the presentation logic layer are separated from each other, and now the different layers have some
The support of the mature development framework. For example, struts is the use of Java Web Development technology to implement the MVC design pattern, but also in the business logic layer
There is a spring framework, and the database persistence layer has a framework such as hibernate. These frameworks make it easy for developers to structure efficiently, rationally and scientifically
Multi-layered commercial applications.
Here's a brief look at struts, which is essentially an MVC implemented on the basis of JSP Model2 (Model, View,
Controler) framework. JSP Model2 Architecture is a method of combining JSP and servlet to provide dynamic content. In struts
Framework, the model consists of JavaBean or EJB components that implement the business logic, and the controller is implemented by the servlet, and the view consists of a set of JSP files
Composition Using struts, you can define the definition of roles and the division of labor between developers and web designers. And the more complex the project, the more obvious its advantages.
Vii. Source code Security
PHP development of the program's source code is public, others get PHP development program can be modified.
Java Development Program, the last user to get is just some compiled class class, can not see the full source code, security high

Eight, performance comparison
Some people have done experiments on these two languages to do loop performance testing and access to Oracle database testing.
In the cyclic performance test, the JSP ended the 20000*20000 loop with only an astonishing four seconds. And the PHP test is
2000*2000 cycle (less than one order of magnitude), but took 63 seconds respectively.
In database testing, the two 1000 insert,update,select and delete:jsp of Oracle 8 are required for 13 seconds
, PHP takes 69 seconds.







To sum up, I personally think that PHP is suitable for rapid development, small and medium-sized applications, development costs are low, to change the need to make rapid
Rapid response. Java is suitable for the development of large-scale application system, the prospect of application is broad, the system is easy to maintain, reusability is better. And also
, the system developed by the same function in Java is higher than the price of a system developed by PHP.



Java version-to-Business enterprise: http://www.itonghui.com/index.html
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.