Comparison of ASP, JSP and PHP

xiaoxiao2021-03-06  62

Currently, the most commonly used three dynamic web languages ​​include ASP (Java Server Pages).

PHP (Hypertext Preprocessor).

Conclude

ASP full name Active Server Pages, is a development environment of a web server, which uses it to produce and transport

Active, interactive, high-performance web service applications. ASP uses scripting language VB Script (Java Script

) As its own development language.

PHP is an embedded scripting language cross-platform server side. It is a large number of syntax of C, Java and Perl language.

And couple the PHP's own characteristics, so that the web developers can quickly write out the dynamic generating page. It supports the current few

According to the library. Another point, PHP is completely free, don't spend money, you can start from the official site of PHP (

http://www.php.ne

t) free download. And you can get the source code unrestricted, and you can even add the features you need.

JSP is a new generation of sites launched by Sun, and he completely solves a common problem of current ASP, PHP -

The script level is executed (it is said that PHP4 has also been supported by Zend, realizing compilation and running). SUN company is in Jav

Available on A, the Java has a new fruit from the Java application and Java Applet, that is, JS

P - Java Server Page. JSP can complete powerful sites with the support of Serverlet and JavaBean

program.

The three provide a mixing of some kind of program code in the HTML code, and the ability to execute program code is explained by the language engine.

However, the JSP code is compiled into a servlet and interpreted by the Java virtual machine, which is only on the JSP page.

The first request occurs. In ASP, PHP, JSP environments, HTML code is mainly responsible for describing information display style.

And the program code is used to describe processing logic. Ordinary HTML page only depends on the web server, and ASP, PH

P, JSP page requires additional language engine analysis and execution program code. The execution result of the program code is re-embedded

In the HTML code, then send it to the browser together. ASP, PHP, JSP is both technology for web servers

The client browser does not require any additional software support.

Technical characteristics

ASP:

1. Use the simple and easy-to-understand scripting language such as VBScript, JScript, and combine HTML code to complete

Website application.

2. No compile is compiled, easy to write, can be executed directly on the server side.

3. Use a normal text editor, such as Windows notepad, you can edit design.

4. Unrelated to the browser (Browser Independence), the client only uses a browser that can perform HTML code, ie

You can browse the web content designed by Active Server Pages. Scriptomes used by Active Server Pages

Both of the words (VBScript, JScript) are executed in the web server, and the user-end browser does not need to be executed.

Scripting language.

5.active Server Pages can be compatible with any ActiveX Scripting language. In addition to VBScript

Or JScript language is designed, and the other scripting languages ​​provided by third parties are used through the plug-in method.

For example, REXX, Perl, TCL, etc. The script engine is a COM (Component Object Mod) that handles the script.

EL) object.

6. Use the server-side script to generate the client's script.

7.activeX Server Components has unlimited expansion. Can use VI

SUAL Basic, Java, Visual C , COBOL and other programming languages ​​to write the ActiveX SE you need

RVER Component.

PHP:

1. Database Connectivity

PHP can be compiled into a function that is connected to many database. PHP and MySQL are now a great combination. You can also

Take indirect access to your database with your own function. Through this path When you replace the database, you can

Easily change the encoding to adapt to this change. PHPLIB is the most commonly used group of base libraries that can provide general transaction needs.

. However, the database interface provided by PHP supports each other, such as the interface of Oracle, MySQL, Sybase, each other.

Not the same. This is also a weakness of PHP.

2. Object-Oriented Programming

PHP provides classes and objects. Web-based programming work is very important for object-oriented programming capabilities. PHP supports constructors,

Extract, etc..

JSP:

1. Separate the generation and display of the content

With JSP technology, web page developers can use HTML or XML identity to design and format the final page. Make

Use a JSP identifier or a small script to generate dynamic content on the page. The logic of generating content is packaged in the identifier and javabeans

In the component, and bundle in a small script, all scripts are running on the server. If the core logic is encapsulated in the identity and

Beans, then others, such as web managers and page designers, can edit and use JSP pages, without affecting

Generate.

In the server side, the JSP engine explains the JSP ID and the small script, generates the requested content (for example, by accessing Java)

Beans components, use JDBCTM technology to access databases, or include files), and will result in HTML (or XML)

The page is sent back to the browser. This helps the author to protect your code, and guarantee any HTML-based web browsing

Of full availability of the unit.

2. Emphasize reusable components

Most JSP pages rely on reusable, cross-platform components (JavaBeans or Enterprise Javabea)

NSTM components) to perform more complex processing required by the application. Developers can share and exchange implementation of ordinary operations

Make components, or such components are used for more users or customer groups. Component-based method accelerated

The overall development process has enabled various organizations to balance in the development efforts of their existing skills and optimization results.

3. Simplify page development with identification

Web page developers will not be familiar with programmers for scripting languages. JavaServer Page technology has been encapsulated many

Function, these functions are desired to be dynamically generated in ease of use, with the JSP-related XML identity. Standard JS

P Identifies to access and instantiate the JavaBeans component, set or retrieve component properties, download applet, and execute

Other methods are more difficult to encode and time consuming.

JSP technology can be extended by developing customized logo depots. In the future, third-party developers and others can

Create your own identity library for common functions. This allows web page developers to use familiar tools and like identity.

The component to perform a specific function is working.

JSP technology is easy to integrate into a variety of application architecture to utilize existing tools and techniques, and extend to capable

Support enterprise-class distributed applications. As part of the Java technical family, as well as Java 2 (enterprise version of the architecture

An component, JSP technology can support highly complex web-based applications.

Since the built-in scripting language of the JSP page is based on Java programming languages, and all JSP pages are compiled into Java Servlet, the JSP page has all benefits of Java technology, including robust storage management and security.

As part of the Java platform, JSP has the characteristics of Java programming languages ​​"a written, running". With more

The more suppliers add JSP to their products, you can use your own server and tools, more

Change the tool or server does not affect the current application.

Application range

ASP is a dynamic web language developed by Microsoft, which inherits the consistent tradition of Microsoft products - can only run in Microsoft

Server product, IIS (Internet Information Server) (Windows NT) (Windows NT), PWS (Personal Web SE

RVER) (Windows 98). There are also Chilisoft plugins under UNIX to support the ASP, but the ability of the ASP itself is limited.

It must be expanded by the combination of ASP COM, and the COM under UNIX is very difficult.

PHP3 can run normally on Windows, UNIX, Linux web server, but also supports universal web servers such as IIS, Apache

When the user replaces the platform, there is no need to change the PHP3 code, you can use it now.

JSP is similar to PHP3, almost runs on all platforms. Such as Win NT, Linux, UNIX. NT IIS through a plug

For example, JRUN or ServletExec, JSP can be supported. The famous Web server Apache has been able to support JSP.

Since Apache is widely used in NT, UNIX, and Linux, JSP has a wider range of operational platforms. Although NT operation now

The system accounts for a large market share, but the advantage of UNIX in the server is still very big, and the new rise Linux is coming.

Not small. Transplant from one platform to another platform, JSP and JavaBean don't even need to recompile because Java bytes

The code is all standard and platform-independent.

Performance comparison

Some people have done their tests, which do cycle performance tests and access to Oracle database testing, respectively.

In cycle performance test, JSP only ends 20000 * 20,000 cycles with a surprising four seconds. ASP

The PHP test is 2000 * 2000 loop (less orders), but uses 63 seconds and 84 seconds, respectively. (Refer to phpo)

.

In the database test, the three are performed for Oracle 8 for 1000 INSERT, UPDATE, SELECT, and DELETE.

: JSP takes 13 seconds, PHP takes 69 seconds, and the ASP takes 73 seconds.

Prospect analysis

Currently, PHP and ASP applications in China is most extensive. JSP is a less than a new technology. In

Foreign, JSP is already a popular technology, especially the website of e-commerce, and uses JSP.

PHP's website such as Sina.com, Chinese (China), etc., but due to some of the lack of PHP itself

Point, make it unsuitable for large-scale e-commerce sites, and more suitable for some small business sites.

First, PHP lacks scale support. Second, lack of multi-layer structural support. For large load sites, the solution is only one

Issue: Distribution calculation. Database, application logic layer, indicating that the logical layer is separated from each other, and the same level can be separated according to the flow

, Constitute a two-dimensional array. And PHP lacks this support. There is also a point mentioned above, the database interface support provided by PHP

It is not uniform, which makes it not suitable for e-commerce.

ASP and JSP do not have the above defects, ASP can get ActiveX size support through Microsoft Windows COM / DCOM, access structure support through DCOM and Transcation Server; JSP can pass Sun Java Java Clas

S and EJB get scale support, access structural support through EJB / CORBA, and many vendors' Application Server.

Among the three, JSP should be the trend of future development. Some large e-commerce solution providers in the world use J

SP / servlet. Compared with IBM's E-Business, its core is WebSphere with JSP / servlet;

Another very famous e-commerce software provider, intershop. Its original products intershop1 2, 3

4 4 occupied the major e-commerce software share. They are all supported by CGI. But it launched after October last year.

Enfinity, an e-commerce Application Server with JSP / Servlet, and the reputation no longer develops tradition

software.

In short

ASP, PHP, and JSP have considerable number of supporters, which can also be seen that all of them have their own strengths. Learning or

Friends using dynamic pages can choose a language suitable for yourself according to the characteristics of the three.

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

New Post(0)