Comparison of ASP, JSP, and PHP technologies

Source: Internet
Author: User
Tags php and mysql

Currently, the three most common dynamic web page languages are Asp (Active Server Pages), JSP (LOGIN erver pages), and PHP (Hypertext Preprocessor ).

Introduction

ASP full name Active Server Pages is a web server development environment that can be used to generate and execute dynamic, interactive, and high-performance Web service applications.Program. ASP uses the script language VBScript (Java Script) as its own development language.

PHP is a cross-platform server-side embedded scripting language. It relies heavily on the syntax of C, Java, and Perl, coupled with PHP's own features, so that web developers can quickly write dynamic pages. It supports the vast majority of databases currently. Another point is that PHP is completely free of charge. You can freely download it from the official site of PHP (http: // www.php.net. In addition, you can obtain the source code without restrictions, and even add the features you need.

JSP is a new generation of website development language launched by Sun. With its remarkable accomplishments in Java, Sun has made new achievements in Java applications and Java applets, is JSP, Java Server Page. JSP supports powerful site programs with the support of serverlet and JavaBean.

all three provide the ability to mix some program code in HTML Code and explain and execute the program code by the Language engine. However, JSP code is compiled into a Servlet and interpreted and executed by the Java Virtual Machine. This compilation operation only occurs during the first request to the JSP page. In ASP, PHP, and JSP environments, HTML code describes the display style of information, while program code describes the processing logic. Common HTML pages only depend on Web servers, while ASP, PHP, and JSP pages require additional language engines to analyze and execute program code. The execution result of the program code is re-embedded into the HTML code and sent to the browser together. ASP, PHP, and JSP are all web server-oriented technologies. Client browsers do not require any additional software support.

Technical Features:

ASP:

1. Using VBScript, JScript, and other easy-to-understand scripting languages, combined with HTML code, you can quickly complete website applications.

2. It is easy to compile without compile compilation and can be directly executed on the server side.

3. Use a common text editor, such as a Windows notepad, to edit the design.

4. browser independence. The client only needs to use a browser that can execute HTML code to browse the webpage content designed by Active Server Pages. The scripting languages (VBScript and JScript) used by active serverpages are all executed on the Web server. The client browser does not need to be able to execute these scripting languages.

5. The Active Server Pages can be compatible with any ActiveX Scripting Language. In addition to using VB script or JScript, you can also use other scripting languages provided by a third party, such as Rexx, Perl, and TCL, in Plug-In mode. The script engine is a COM (Component Object Model) object that processes the script program.

6. Use the server script to generate the client script.

7. ActiveX Server Components (ActiveX Server Component) is infinitely scalable. You can use Visual Basic, Java, Visual C ++, COBOL, and other programming languages to compile your required ActiveX Server component.

PHP:

1. Database Connection

PHP can be compiled into functions connected to many databases. PHP and MySQL are a perfect group combination. You can also write peripheral functions to indirectly access the database. In this way, when you change the database you are using, you can easily modify the encoding to adapt to this change. Phplib is the most commonly used base database to provide general transactions. However, the database interfaces provided by PHP are different from each other. For example, the interfaces for Oracle, MySQL, and Sybase are different from each other. This is also a weakness of PHP.

JSP:

1. Separate content generation and display

With JSP technology, web page developers can use HTML or XML tags to design and format the final page. Use JSP identifiers or small scripts to generate dynamic content on the page. The logic of the generated content is encapsulated in the identification and JavaBeans group, and bundled in the small script, all the scripts are executed on the server. If the core logic is encapsulated in identifiers and beans, other people, such as Web administrators and page designers, can edit and use JSP pages without affecting content generation. On the server side, the JSP Engine interprets the jsp id to generate the requested content (for example, accessing the database by accessing the JavaBeans group component and using JDBC technology), and uses HTML (or XML) as the result) page form is sent back to the browser. This helps the author protect his own code and ensure the full availability of any HTML-based Web browser.

2. Reusable group parts

Most JSP pages depend on reusable and cross-platform components (such as JavaBeans or Enterprise JavaBeans) to perform more complex processing required by applications. Developers can share and exchange components that perform common operations, or make these components used by more users or user groups. The component-based method accelerates the overall development process and balances various group organizations with their existing skills and development efforts to optimize the results.

3. Simplified page development with logo

Web page developers are not all programmers familiar with scripting. The assumerver page technology encapsulates many functions that are required to generate dynamic content in easy-to-use and JSP-related XML identifiers. The standard JSP mark can be used to access and instantiate the JavaBeans component, set or retrieve group attributes, download the applet, and execute functions that are more difficult to encode and consume in other ways. Through the development of a custom identification library, JSP technology can be expanded. In the future, third-party developers and others can create their own identification libraries for common functions. This allows web page developers to work with familiar tools and components that execute specific functions like identifiers. JSP technology can easily be integrated into a variety of application architectures to take advantage of existing tools and techniques and extend to support enterprise-level distributed applications. As part of the Java technology family and a member of Java 2ee, JSP technology can support highly complex web-based applications. Because the built-in scripting language of JSP pages is based on the Java programming language, and all JSP pages are compiled into Java Servlet, JSP pages have all the advantages of Java technology, including robust storage management and security. As part of the Java platform, JSP has the characteristics of the Java programming language "one-time writing, execution everywhere. As more and more suppliers add JSP support to their products, you can use the servers and tools you select. Modifying tools or servers does not affect the current applications.

Application Scope:

ASP is a dynamic web page language developed by Microsoft and inherits the consistent tradition of Microsoft products. It can only be executed on Microsoft Server products, IIS (Internet Information Server) (Windows NT) and PWS (Personal Web server) (Windows 98. There are also chilisoft components in UNIX to support ASP. However, Asp has limited functions and must be expanded through ASP + COM group combinations. It is very difficult to implement COM in UNIX.

Php3 can be normally executed on Windows, UNIX, and Linux Web servers. It also supports general web servers such as IIS and Apache. You do not need to change the php3 code when changing the platform, ready for use.

JSP is similar to php3 and can be executed on almost all platforms. Such as Win NT, Linux, and UNIX. In NT, IIS supports JSP through an additional server, such as JRun or ServletExec. Apache, a well-known web server, supports JSP. Because Apache is widely used in NT, UNIX, and Linux, JSP has a wider execution platform. Although the NT operating system has a large market share, the Unix advantage in the server is still great, and the new Linux is not small. Porting from one platform to another, JSP and JavaBean do not even need to be re-compiled, Because Java bytecode is standard and platform-independent.

Performance Comparison:

Some people have performed tests to test the performance of the three languages and to access the Oracle database. In the cyclic performance test, JSP ended the 20000*20000 loop in just four surprising seconds. ASP and PHP test 2000*2000 cycles (one order of magnitude less), but they use 63 s and 84 s respectively. (Refer to phplib ). In the database test, the three performed 1000 insert, update, select, and delete operations on Oracle 8 respectively. It took 13 seconds for JSP, 69 seconds for PHP, and 73 seconds for ASP.

Foreground analysis:

PHP and ASP are widely used in China. JSP is a relatively new technology, which is rarely used in China. However, in foreign countries, JSP is already a popular technology, especially for e-commerce websites, mostly using JSP. Websites using PHP, such as Sina and chinaren, are not suitable for large-scale e-commerce sites due to some shortcomings of PHP, it is more suitable for some small commercial sites. First, PHP lacks support for scale. Second, the lack of multi-layer structure support. For heavy-load sites, there is only one solution: distributed computing. The logical layers of databases and applications are separated from each other, and the same layer can also be divided into two-dimensional arrays based on traffic. PHP lacks such support. As mentioned above, the database interfaces supported by PHP are not uniform, which makes it unsuitable for e-commerce.

ASP and JSP have no such defects. asp can obtain ActiveX scale support through Microsoft windowsd COM/DCOM, and obtain structure support through DCOM and transcation server; JSP can be scaled through Sun Java's Java class and EJB, and structural support can be obtained through EJB/CORBA and Application Server of many vendors. Among the three, JSP should be the future development trend. Some big E-commerce solution providers in the world use JSP/servlet. IBM e-business is well known. Its core is to use the Web sphere of JSP/servlet. They are all supported through CGI. However, after last October, it launched enfinity, an e-commerce application server that uses JSP/servlet, and does not develop traditional software.

In short, ASP, PHP, and JSP all have a considerable number of supporters, so we can see that they have their own strengths. Friends who are learning or using dynamic pages can select a language suitable for themselves based on the characteristics of the three.

From: http://www.blog.edu.cn/more.asp? Name = ntu& id = 52982

Related Article

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.