js| Comparison | dynamic
Currently, the three most popular dynamic page languages are ASP (Active Server pages), JSP (Java Server Pages), PHP (hypertext preprocessor).
Introduction
ASP full Name Active Server Pages is a Web server-side development environment that allows you to generate and run dynamic, interactive, high-performance Web Service applications. ASP uses the scripting language VB Script (Java script) as its own development language.
PHP is a cross-platform, server-side embedded scripting language. It borrows heavily from the syntax of the C,java and Perl languages, and is coupled with PHP's own features, enabling Web developers to quickly write dynamically generated pages. It supports the vast majority of databases currently available. Also, PHP is completely free, and you can download it free from the official PHP site (http://www.php.net) without spending money. And you can gain unlimited access to the source code, and you can even add the features you need.
JSP is the Sun introduced a new generation of site development language, he completely solved the current asp,php a common problem-script-level execution (it is said that PHP4 has also been supported by Zend, the implementation of the compile run). With its own extraordinary Java attainments, Sun has a new fruit in addition to Java applications and Java applets, the Jsp--java Server Page. JSP can complete the powerful site program with the support of Serverlet and JavaBean.
All three provide the ability to mix some kind of program code in HTML code and the language engine to interpret the execution code. However, the JSP code is compiled into a Servlet and interpreted by the Java virtual machine, which occurs only on the first request to the JSP page. In ASP, PHP, JSP Environment, HTML code is mainly responsible for describing the display of information style, and program code is used to describe the processing logic. Ordinary HTML pages rely on only the WEB server, while ASP, PHP, and JSP pages require additional language engine analysis and code execution. The execution results of the program code are then embedded in the HTML code and sent to the browser together. ASP, PHP, JSP three are WEB server-oriented technology, the client browser does not require any additional software support.
Technical features
Asp:
1. Using simple scripting languages such as VBScript, JScript, and HTML code, you can quickly complete your Web site's applications.
2. No compile compile, easy to write, can be directly implemented on the server side.
3. Use a normal text editor, such as a notepad for Windows, for editing and design.
4. Browser-Independent (Browser independence), the client can browse the content of Web pages that are designed by Active Server pages as long as they use an executable HTML code browser. The scripting language (VBScript, Jscript) used by Active server Pages is executed on the WEB server side, and the client's browser does not need to be able to execute these scripting languages.
5.Active Server Pages can be compatible with any ActiveX scripting language. In addition to being designed using VBScript or JScript languages, other scripting languages provided by third parties, such as REXX, Perl, TCL, are used in plug-in. The scripting engine is a COM (Component object Model) object that handles a script program.
6. Server-side scripts can be used to generate client script.
7.ActiveX Server components (ActiveX server component) has unlimited scalability. You can use the programming languages of Visual Basic, Java, Visual C + +, COBOL to write the ActiveX Server Component you need.
Php:
1. Database connection
PHP can be compiled into functions that have connections to many databases. PHP and MySQL are now the perfect combination. You can also write your own peripheral functions to access the database indirectly. This way you can easily change the encoding to accommodate this change when you replace the database you are using. Phplib is the most common set of base libraries that can provide general transaction needs. But PHP provides database interfaces that are not consistent with each other, such as Oracle, MySQL, and Sybase interfaces. This is also a weakness of PHP.
2. Object Oriented Programming
PHP provides classes and objects. Web-based programming is a great need for object-oriented programming capabilities. PHP supports constructors, extraction classes, and so on.
Jsp:
1. Separating the generation and display of content
Using JSP technology, Web page developers can use HTML or XML identities to design and format final pages. Use the JSP logo or the little script to generate dynamic content on the page. The logic for generating content is encapsulated in identity and JavaBeans components, and bundled in small scripts, all scripts run on the server side. If the core logic is encapsulated in logos and beans, then others, such as Web managers and page designers, can edit and use JSP pages without affecting the generation of content.
On the server side, the JSP engine interprets JSP IDs and small scripts to generate the requested content (for example, by accessing the JavaBeans component, accessing the database using JDBCTM technology, or including files), and sending the results back to the browser as an HTML (or XML) page. This helps authors protect their own code while ensuring the full availability of any html-based Web browser.
2. Emphasis on reusable components
Most JSP pages rely on reusable, cross-platform components (JavaBeans or Enterprise javabeanstm components) to perform the more complex processing required by the application. Developers can share and Exchange components that perform common operations or make these components available to more users or customer groups. The component-based approach accelerates the overall development process and enables organizations to balance their existing skills and the development efforts of optimized results.
3. Using logo to simplify page development
Web page developers are not all programmers who are familiar with scripting languages. The JavaServer page technology encapsulates a number of features that are needed to make dynamic content generation in an easy-to-use, JSP-related XML identity. The standard JSP identity is able to access and instantiate JavaBeans components, set or retrieve component properties, download applets, and perform features that are more difficult to encode and time consuming in other ways.
JSP technology can be extended by developing a customized identity library. In the future, third party developers and others can create their own identity libraries for common functions. This enables Web page developers to work with familiar tools and artifacts that perform specific functions like identities.
JSP technology is easily integrated into a variety of application architectures to leverage existing tools and techniques and to scale to support enterprise-class distributed applications. As part of the Java technology family and as part of the Java 2 (Enterprise Architecture), JSP technology can support highly complex web-based applications.
Because the built-in scripting language for JSP pages is based on the Java programming language, and all JSP pages are compiled into Java servlet,jsp pages, they have all the benefits of Java technology, including robust storage management and security.
As part of the Java platform, JSP has the Java programming language "once written, run everywhere" features. As more and more vendors add JSP support to their products, you can use the servers and tools of your choice, and changing tools or servers does not affect your current application.
Application Range
ASP, a dynamic Web language developed by Microsoft, also inherits the traditional Microsoft products-run only on Microsoft server products, IIS (Internet Information Server) (Windows NT) and PWS (Personal Web Server) (Windows 98). UNIX also has chilisoft plug-ins to support the ASP, but the ASP itself has limited functionality, it must be extended through the combination of asp+com, UNIX under the implementation of COM is very difficult.
PHP3 can run normally on a Windows,unix,linux Web server, and it also supports general-purpose web servers such as Iis,apache, which can be used without the need to transform PHP3 code when changing the platform.
JSP is similar to PHP3 and can run on almost all platforms. such as Win Nt,linux,unix. NT under IIS can support JSP through a plug-in, such as JRun or servletexec. The famous Web server Apache has been able to support JSP. Because Apache is widely used on NT, UNIX, and Linux, JSP has a wider operating platform. Although the NT operating system now occupies a large market share, but the advantages of UNIX in the server is still very large, and the new rise of Linux is not small. Porting from one platform to another, JSP and JavaBean don't even have to recompile because Java bytecode is standard and platform-independent.
Performance comparison
Experiments have been done to perform cyclic performance testing and access to Oracle database tests for these three languages.
In the cyclic performance test, the JSP ended the 20000*20000 cycle with only an astonishing four seconds. And the ASP, PHP test is the 2000*2000 cycle (one less order of magnitude), but used 63 seconds and 84 seconds respectively. (Refer to Phplib).
In the database test, the three 1000 insert,update,select to Oracle 8, and delete:jsp need 13 seconds, PHP needs 69 seconds, ASP will need 73 seconds.
Prospect Analysis
Currently in the domestic PHP and ASP applications most widely. And JSP is a relatively new technology, the domestic use of less. But in foreign countries, JSP has become a more popular technology, especially E-commerce-class Web sites, using JSP more.
Using PHP's website such as Sina, Chinese (chinaren), etc., but because of PHP's own shortcomings, makes it not suitable for large-scale e-commerce sites, but more suitable for a number of small commercial sites.
First, PHP lacks scale support. Secondly, the lack of multi-layer structure support. For a large load site, there is only one solution: distribution calculation. The database, the application logic layer, the representation logic layer are separated from each other, and the same layer can be separated according to the traffic, and form a two-dimensional array. and PHP lacks that support. Also mentioned above, the database interface provided by PHP is not uniform, which makes it unsuitable for use in e-commerce.
ASP and JSP do not have the above flaw, ASP can obtain the ActiveX scale support through the Microsoft WINDOWSD com/dcom, obtains the structure support through DCOM and Transcation server, the JSP can pass through the sun Java Java class and EJB are supported by scale, supported by Ejb/corba and many vendors ' application servers.
Among the three, JSP should be the trend of future development. Some of the world's largest e-commerce solution providers use Jsp/servlet. More famous as IBM's e-business, its core is the use of Jsp/servlet WebSphere, another western very famous E-commerce software provider, Intershop. Its original product INTERSHOP1 2, 3, 4 accounted for the main E-commerce software share. They are all supported by CGI. But last October it launched the enfinity, a jsp/servlet e-commerce application Server, and vowed not to develop traditional software.
Anyway
Asp,php,jsp Three have a considerable number of supporters, which can also be seen with their strengths. A friend who is learning or using a dynamic page can choose a language appropriate to his or her own according to the characteristics of the three.