| << 2.5.1- Client-Side Alternatives | Chapter2 | 2.6.0- Summary >> |
Server-Side Alternatives
There are also several more direct competitors to ASP. We're going to look at what we consider to be four important technologies, in chronological order starting with the oldest. They don't necessarily all perform the same tasks as ASP, but they all allow the user to achieve the same end-result – that of dynamic web applications. If ASP is not an ideal solution to your problems, then you might want to consider these following technologies, taking into account the following questions:
- Are they supported on the platform you use?
- Are they difficult to learn?
- Do they have extra capabilities, such as being able to parse XML?
- We're not going to favor one option over another, but give a quick overview of what each one does.
CGI
The Common Gateway Interface (CGI) is a mechanism for creating scripts on the server, which can then be used to create dynamic web applications. It has been around for quite a bit longer than ASP, and right now the majority of dynamically-created pages on the web are created using CGI and a scripting language. However, it's incorrect to assume that CGI does the same job as ASP. Rather, CGI allows the user to invoke another program (such as a Perl script) on the web server to create the dynamic web page, and the role of CGI is to pass the user-supplied data to the this program for processing. However, it does provide the same end-result – a dynamic web application.
However, CGI has some severe shortcomings. The major one is that it adds an extra level to our browser–server model of interaction: namely, it's necessary to run a CGI program to create the dynamic page, before the page is processed on the server. Also, the format in which CGI receives and transmits data means that this data is not easily manipulated by many programming languages, so you have to use a programming language that has good facilities for manipulating text and communicating with other software. The most able programming languages that can work on any operating system for doing this are C, C++ and Perl. While they can adequately do the job for you, they're some of the more complex languages to learn. Visual Basic doesn't offer sufficiently adequate text-handling facilities, and is therefore rarely used with CGI.
ColdFusion
ColdFusion (http://www.adobe.com/products/coldfusion/ ) also enables servers to access data as the server builds an HTML page. Like ASP, ColdFusion pages are readable by any browser. ColdFusion also utilizes a proprietary set of tags, which are processed by the ColdFusion Server software. This server software can run on multiple platforms, including Microsoft IIS, Netscape Enterprise Server and Unix/Apache. The major difference is that while ASP solutions are built primarily with VBScript and objects, ColdFusion utilizes the tags, which encapsulate functionality. ColdFusion lacks some of the internal ASP objects; however it sports its own set of solutions to common problems, including access to ADO functionality. Like ASP, ColdFusion has gone through many new versions over the last several years so you are encouraged to check out the Adobe link above for the specific features and support in the current ColdFusion version.
Java Server Pages
JavaServer Pages (JSP) is a technology that allows you to combine markup (HTML or XML) with Java code to dynamically generate web-pages. The JSP specification is implemented by several web servers, and plug-ins are available that allow you to use JSP with IIS 4.0. One of the main advantages of JSP is the portability of code between different servers. JavaServer Pages isn't directly related ASP, but it does boast the ability to embed Java code into your web pages using server-side tags, in the same way that ASP script can be embedded into web pages. More details can be found in the JSP FAQ at http://java.sun.com/products/jsp/faq.html.
PHP
PHP: Hypertext Preprocessor (PHP) is server-side scripting language for creating dynamic web pages. When a visitor opens the page, the server processes the PHP commands and then sends the results to the visitor's browser, just as with ASP or ColdFusion. Unlike ASP or ColdFusion, PHP is open-source and cross-platform. PHP runs on Windows and many Unix versions, and it can be built as an Apache module and as a binary that can run as a CGI. When built as an Apache module, PHP is especially speedy. A downside is that you have to download PHP separately and go through a series of quite complex steps to install it and get it working on your machine. Also PHP's session management was non-existent until PHP 4, and still inferior to ASP's even now.
In addition to manipulating the content of your pages, PHP, like IIS, can also send HTTP headers. You can set cookies, manage authentication, and redirect users. It offers good connectivity to many databases (and ODBC), and integration with various external libraries that let you do everything from generating PDF documents to parsing XML.
PHP, like ASP, can also go right into your Web pages. You can start a block of PHP code with <?php and end it with ?>. (You can also configure PHP to use ASP-style <% … %> tags or even <SCRIPT LANGUAGE="php"></SCRIPT>.) The PHP engine processes everything between those tags. PHP's language syntax is similar to C and Perl. This might prove a barrier to people with no prior programming experience, but if you have a background in either language then you might want to take a look. PHP also has some rudimentary object-oriented features, providing a helpful way to organize and encapsulate your code.
Although PHP runs fastest embedded in Apache, there are instructions on the PHP Web site for set up with Microsoft IIS and Netscape Enterprise Server. If you want to try PHP, you can download it at http://www.php.net/. You'll also find a manual that documents all of PHP's functions and features.
| << 2.5.1- Client-Side Alternatives | Chapter2 | 2.6.0- Summary >> |

RSS

