Comparison of Middleware Languages


There are various middleware languages on the market. All perform at least the basic tasks necessary for delivering dynamic data to the Web. These tasks include collecting form data, generating dynamic page content, and sending and receiving cookies. Four of the most commonly used languages are the following:

  • ColdFusion

  • ASP

  • JSP

  • PHP: Hypertext Processor

Another option, Perl (http://www.perl.com), is one of the first commercially adopted programming languages to be used for building Web applications. It was adapted for the Web when there were no other options available.

Perl, however, can be used to write many different kinds of applications, not just ones for the Web. A rich and complex language, its complexity is what makes it distasteful to some users who are not interested in its full capabilities and who want only to add some dynamic text to an HTML file. It takes more effort to use the Perl language to do the same kinds of tasks that the other four languages can do. You will examine ColdFusion, ASP, JSP, and PHP in depth in the sections that follow.

These languages perform advanced data management tasks equally well. What differs among them is the extent to which they provide hooks into other software and objects on the server, how easy they are to use or set up, and the server environment that is required for them to work. Understanding the differences among them will help when your needs turn toward incorporating a server-side programming tool in your arsenal. First, however, we should go over how middleware applications work.

Middleware application files are saved on the server as templates. These template files contain the instructions written in whatever language or syntax the server understands. All middleware application languages except Perl support the inclusion of client-side scripting in line with the server scripts or tags. Perl has stricter syntax rules; it requires the use of a print function to write HTML or other non-Perl code. (See Figure 28.1.)

Figure 28.1. Hello World example in ColdFusion and Perl.

graphics/28fig01.gif

When the Web server receives a request for an application template, it sends the file to the application server for processing instead of returning it immediately to the browser that made the request. The application server then reads through the file and processes the instructions contained within. During this phase, any scripts not written in the syntax of the application server are ignored. After the application server is done processing, the page is sent to the browser where any HTML or other client-side languages are read. Then, the resulting page is displayed to the user .

Note

Usually, middleware solutions provide dynamic textual content. Macromedia Generator, although not strictly middleware, offers Flash developers a venue through which they can incorporate dynamic graphic content.


ColdFusion

Found at http://www.macromedia.com/coldfusion, the complete ColdFusion package has two components : a development server and an integrated development environment. (See Figure 28.2.) The server can be acquired in four different versions, each varying either by cost or by feature set. The highest-end version is the ColdFusion Enterprise Edition. ColdFusion Studio is the Integrated Development Environment (IDE) that completes the set, although a developer is free to use any text-based editor to create the templates.

Figure 28.2. Allaire's Web site.

graphics/28fig02.gif

Versions of the ColdFusion Server include the following:

  • ColdFusion Enterprise

  • ColdFusion Professional

  • ColdFusion Single Developer Edition

  • ColdFusion Express

Enterprise is the most fully featured and expensive version of ColdFusion. This version of the server is feature-complete, enabling development options beyond normal file processing and data manipulation. Enterprise is equipped with advanced services that enable granular security implementations , remote development services, graphing, server clustering services, and the ability to create, maintain, and search against verity.

The Enterprise version of ColdFusion is not a cheap buy, however. To take advantage of these and other benefits of the server, you or someone close to you will need to spend approximately $3,500 per processor. A more cost-effective option is ColdFusion Professional at $1,300 per processor. Professional comes equipped with most of the same features as Enterprise, except for the Advanced Security, Clustering, and Native Database connections.

A single developer edition of Professional ColdFusion Server comes bundled with ColdFusion Studio, the IDE targeted toward ColdFusion developers. This version of the product is fully equipped with all the features ColdFusion Enterprise has to offer. However, it limits Web access to ColdFusion templates to one concurrent Web user. This restricted access still enables a developer who has invested in Studio to begin building a fully featured Web application before committing to a larger purchase.

ColdFusion Express, also known as ColdFusion Lite, is a free version of the server. This free version can be used for more than just prototype development; it can be your production application server, but only if your needs fall within its restricted range. Express supports only a limited set of desktop databases, most notably Access and SQL Server; stored procedure processing has been removed from this version. Essentially, Express is equipped only with the core ability to serve up dynamic content to the Web. Even as restricted as this is, Express can be a useful tool for learning how to develop a basic ColdFusion application without having to invest in a purchase first.

ColdFusion Enterprise runs on Windows, Solaris, Linux, and HP-UX platforms. Professional and Express run on Windows and Linux systems only.

Note

The Allaire mirror of Macromedia's ColdFusion Web site has a link to information that shows you the differences among the Enterprise, Professional, and Express versions of ColdFusion Server. Go to http://www.allaire.com and search the site for "Edition Comparison Matrix."


What Stands Out

The most praised advantage of ColdFusion over other middleware systems is the low learning curve associated with ColdFusion Markup Language (CFML), the tag-based markup language ColdFusion Server uses to process programmer instructions. Although ColdFusion 5.0 Server is written in C++ and the next version will be written in Java, ColdFusion processing instructions are abstracted into an HTML tag-like syntax. Because of this abstraction, in a relatively short period of time, a beginner can build a serviceable Web application, access dynamic data, and display it in an HTML layout. This enables developers who have no previous experience with programming to quickly grasp the logic, syntax, and structures of server-side manipulation.

Perhaps the most intriguing feature of ColdFusion for Flash developers is the fact that Macromedia has recently merged with Allaire, ColdFusion's original manufacturer. Even in the years prior to this merger, Macromedia and Allaire products operated well together. Now that they are both under the same roof, the way in which Macromedia develops the product roadmaps of the two technologies will be interesting.

Corporate and Community Support

Macromedia supports ColdFusion by providing forums and developer resources on its Web site. These resources include articles, technical notes and documentation, and a developer gallery to which ColdFusion users can upload libraries of code to share their techniques with others.

Macromedia certified training facilities are widely available. They provide another avenue of corporate support. In addition, you can contact Macromedia directly and pay to have Macromedia technical personnel investigate your problem.

There also are many privately run Web sites and tutorials. One useful source for Flash developers is http://www.flashcfm.com, which is a site that posts tutorials specifically targeted toward those who use ColdFusion with Flash. Another resource is a prolific ColdFusion mailing list, CF-Talk (http://www.houseoffusion.com). It receives dozens to hundreds of emails daily. ColdFusion User Group (CFUG) meetings occur in various locations, giving developers an opportunity to meet and network face-to-face while sharing ColdFusion tips, tricks, and techniques. In addition, you can access an online magazine at http://www.svs-con.com/coldfusion.

Note

You might want to choose ColdFusion as your middleware server if any of the following are true:

  • You are not from a programming background.

  • You prefer the use of a tag-based language, such as HTML.

  • You are developing a site basic enough to use the free, reduced functionality version of ColdFusion Server.

  • You need the advanced capabilities of the Professional or Enterprise editions.

  • You need to get an application up and running in a small timeframe.


ASP

Found at http://msdn.microsoft.com/asp, ASP is Microsoft's offering to the world of Web application development. (See .) By itself, the phrase "active server page" could actually apply to any of the technologies in this section. An active server page is simply an HTML page that includes embedded programs that are processed on the server. The end result of an active server page usually is a tailored HTML document served to the user, where the original HTML document and scripts act as a template for the end product. Microsoft has incorporated ASP as the handle of its own implementation of an active server page.

Figure 28.3. Microsoft Developer Network's ASP page.

graphics/28fig03.gif

Visual Basic is a graphical programming environment that results in code written in the BASIC programming language. The main language behind ASP is VBScript, which is a script version of Visual Basic. In addition, ASP pages can use JScript coding. This coding is another Microsoft scripting language that is analogous to JavaScript.

Some people who choose ASP might do so because their development background is in Windows application scripting, which often uses VBScript or Visual Basic. If you bring Visual Basic experience with you, it won't be difficult for you to start working with ASP. For those who don't have experience in VBScript or JScript, however, the learning curve will be a little steeper while learning ASP than while learning ColdFusion.

ASP development does not give a developer many out-of-the box resources. Development of more complicated modules is more of a do-it-yourself proposition. However, to that end, ASP has excellent support for accessing Component Object Model (COM) objects. COM is a technology in which applications can share functionality by using reusable program building blocks. For example, when you are able to open a Microsoft Word document directly in a browser window, you are seeing COM at work. The browser was able to call a COM object that brought Word's functionality into the realm of the browser's operation.

What Stands Out

The biggest selling point for ASP is that there is no sale involved. ASP is distributed with all Windows platforms, and the Microsoft Web servers with which it operates are set up for ASP use from the start. It's free, it's available, and it's no trouble to find developers who already use it. However, this freedom comes with a price. As a Microsoft product, ASP is tied to Microsoft platforms. Although any browser can request and display results from an ASP application, only Microsoft operating systems and servers can work with ASP applications. It is possible to use ASP clones that run on other platforms and servers, but most of these are not free and none is supported by Microsoft's development resources.

Note

ChiliSoft ASP (http://www.chilisoft.com) is a third-party ASP clone that operates on Apache, iPlanet, and O'Reilley Web servers. It differs from ASP in that it provides support for Java, EJB, and CORBA objects.


Corporate and Community Support

As a direct result of ASP's ubiquitous availability, you don't have to look hard to find a Web application programmer who has worked in ASP to join your team. You also don't need to spend a lot of effort looking for Web sites, forums, or listservs. Although Microsoft does not provide support subscriptions as does Macromedia for its

ColdFusion product, it hosts an enormous online developer network where many ASP issues can be researched. Some sites of note are http://www.asplists.com (a mailing list) and http://www.aspin.com (a resource Web site).

Note

You might want to choose ASP as your middleware server if any one of the following is true:

  • You are deploying on an IIS or PWS Web server.

  • You need a free application server.

  • You have previous programming experience with VBScript.

  • You want the ability to draw on a large network of developers.

  • You will make extensive use of native Windows components.


Java Servlet/JSP

Found at http://java.sun.com/products/jsp/, JSP is a Java version of ASP. (See Figure 28.4.) Because JSP is based on Java, it inherits all the advantages of the language: object orientation, portability, and platform independence.

Figure 28.4. Sun Microsystem's JSP page.

graphics/28fig04.gif

JSP differs from Java because, like ColdFusion and PHP, it is tag based. JSP tags are XML wrappers that encapsulate the Java page generation logic, keeping it separate from content formatting and display elements. JSP also enables you to further separate logic from content, giving you the choice of keeping application logic completely separate. You can store it in server-based resources (JavaBeans) rather than coding it along with content and HTML formatting.

Java is easier to learn than C++, which is the language it was developed to resemble, and JSP makes working with Java easier with the use of a tag-based syntax. However, only a developer who is armed with previous Java programming experience will find JSP a quick language to learn. Of the four middleware technologies covered in this section, JSP has the highest learning curve because if you don't know Java, you won't easily understand JSP.

What Stands Out

Java, and its family of languages and methodologies, arguably holds the highest potential for powerful, scalable, and portable Web development. However, because seasoned Java developers are scarce and expensive to come by, you are not likely to see large Java applications developed cheaply.

Further emphasizing its platform independence, JSP templates can be distributed from more than one application server, unlike ColdFusion, PHP, and ASP. Tomcat, the official servlet container and JSP implementation from Sun Microsystems, is open source and free. If you prefer, you can use Macromedia JRun and take advantage of that system's frills, among them a Web-based interface and clustering capabilities. However, this choice will likely incur cost. Macromedia offers its JRun servlet implementation in four flavors, just like the ColdFusion product. JRun ranges in price, from a free developer edition to $5,000 for the full Enterprise version.

Corporate and Community Support

JSP is receiving a lot of attention from the corporate sector. Its advantages entice large enterprise businesses to make it their choice. Macromedia is beginning to offer training courses that highlight JPS use on its JRun platform, and there are some JRun user groups and at least one useful online forum (http://forums.java.sun.com). However, it seems that in terms of an easily accessible and knowledgeable developer community, JSP is lagging behind the others.

Note

You may want to choose JSP as your middleware server if one of the following is true:

  • You know Java.

  • You have access to a pool of good Java developers.

  • You want to deploy the application server on any platform, including Macintosh.


PHP: Hypertext Processor

Found at http://www.php4.net, PHP is an open source programming language that has recently gained prominence in the middleware marketplace . (See Figure 28.5.) It found its beginnings as a personal project of Rasmus Lerdorf, who wanted to add a scripting element to his home page. Like the ColdFusion application server, PHP was built to dynamically create HTML pages, embedding the PHP syntax among the HTML to include dynamic elements and serve the resulting page to the Web. Since 1994, thousands of programmers with backgrounds in C, Perl, and Java have modified and extended the language. Today, it is likely the favorite development server for those operating on the UNIX platform. In addition, it can be used on Microsoft Win32 systems and Macintosh's OS X.

Figure 28.5. The PHP Group, a comprehensive PHP developer resource site.

graphics/28fig05.gif

The learning curve for PHP is on a par with ASP. No one particular language will give you better preparation for PHP than another, but someone with prior programming knowledge will find it easier to learn PHP.

What Stands Out

PHP uses native database connections to manage data retrieval and does so very well, but this strength might also be its greatest weakness. Compared to ColdFusion especially , the problem becomes clear. ColdFusion database connections are abstracted so that all a developer must know is the tag syntax, which is very simple, and the SQL statement. ColdFusion does provide support for using native database drivers, but only if the more expensive Enterprise edition is running. PHP naturally requires that database connections be made in the native language of the target RDBMS, and that requirement makes it a less portable choice.

For instance, if an application were deployed using an Access database and then later upsized to an Oracle database, making the change would be simple in ColdFusion. The same change would be complicated in PHP. The ColdFusion tag that manages database connections would require one change among its attribute definitions. That change would prompt ColdFusion Server to process the switch. From a developer's standpoint, you barely need to do anything differently, except perhaps change the SQL statement into Oracle SQL syntax. In a PHP version of the application, the entire code block that handled connecting to the Access database would need to be recoded using the proper connection terminology and syntax for Oracle.

An interesting PHP feature to note is its support for regular expressions. Although the other options discussed in this section also parse RegEx, PHP is the only one to have developed two parsers. One is POSIX compliant, and the other works in a manner similar to Perl.

Corporate and Community Support

The corporate world has not really embraced PHP. Seeming to believe in the homily "You get what you pay for," many Enterprise businesses shun the free, community-support model of PHP, preferring instead to use a commercial product, like ColdFusion, or a free product that has proper corporate infrastructure, like ASP or JSP. The portability difficulties associated with the way PHP accesses databases natively also add to this reluctance to view PHP as an Enterprise technology solution. You can find some resources on the Web, however. Check out http://www.zend.com (a partner Web site) and http://php.resourceindex.com (a PHP resources site).

Note

You might want to choose PHP as your middleware server if one of the following is true:

  • You are deploying on UNIX,Win32, or OS X.

  • You need a free server product.

  • You are a proponent of open source software.

  • You have programming experience in any server language.


ColdFusion or PHP? ASP or JSP?

Which one should you choose? Does one application server stand out above the others? The short answer is this: no.

When it comes down to the wire, in some cases, circumstances will make the decision of which server product is used. For instance, if an application will be hosted on several servers' varied operating systems and among them is one with a Macintosh operating system, JSP is the most likely choice. If easy access to the greatest number of trained developers is a must, ASP might win over ColdFusion. Other times, programmer preference or past experience might be the deciding factor. If it is important, for instance, that new programmers learn quickly, ColdFusion is best. For forward-thinkers who foresee a major RDBMS upgrade in years to come, PHP might lose in favor of a more portable option.

Surely, however, one of these languages must perform better and serve pages faster, right? With each language listed, a well-coded application running on an optimized installation of software and adhering to best practices of the application program interface (API) will perform nearly identically. Differences in how fast an application serves up its pages, in fact, often are not attributable to the middleware itself, but to contributing factors inherent to the Web server, the database server, coding practices, and even the operating system.



Inside Flash
Inside Flash MX (2nd Edition) (Inside (New Riders))
ISBN: 0735712549
EAN: 2147483647
Year: 2005
Pages: 257
Authors: Jody Keating

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net