Programming the Web

With the tools currently appearing, everything let us believe that programming of scripts and applications for the Web will be soon as easy as local programming thanks to platforms that allow to run these programs designed for the Web, but the actual growing trend, is the possibility to let Web applications running offline too.
To answer several essential questions about programming of the Web and the future which one can foresee, this article confronts the new needs for companies and users with current solutions, and their future developments.

Domains of applications

Web programming monopolizes the activity of the programmers henceforth.
The domains are very varied:
- Creation and design of websites (scripts, Ajax).
- Animation in Flash/XAML.
- Web applications, RIA (Rich Internet Applications).
- Web services.
- CMS (Content Management System).
- Web 2.0, creation of sites powered by with new functionalities allowing for new uses of the Web.

The needs

Net surfers expect in the Web a space of entertainment and leisure, a space of exchanges, some time even a virtual world. That supposes more advanced sites, simplified, interactive and fast.
Enterprises use the Web to promote their products and activities, but also like tool for their personnel and their customers. That supposes the transposition on Internet of professional software, with connection to databases in particular.
Administrations use the Web to replace the wickets. The majority have moved to the Web 2.0 and they save so a lot of money.


Formats of the Web

Pages

After HTML 4, supplemented by style sheets, one could think that XHTML, a more general version derived from XML, being recognized by all recent browsers, was going to become the standard.
But one realizes that the W3C seems to want on the contrary to continue with the HTML format, with a whole of specifications dedicated to applications, including HTML 5 and various form formats which extend the list of current components.

Data

To store data freely, except in databases, the JSON format supplements well JavaScript which recognizes it natively, while XML, safer, bases of many specialized formats as RSS, is used with Ajax. A comparison of XML and JSON may help to choose between these two formats according to the application in project.

Interfaces of applications

Flash is a light vectorial graphics and binary format used to create rich applications. It runs on any browser once the Flash Player plug-in is downloaded. But it now has twi serious competitor with HTML 5 canvas and XAML, the format of Microsoft.
In reaction to the release of the Silverlight plug-in based on XAML, portable and cross-browsers, Adobe has decided to release as open source its Flex editor which produces Flash applications.
See this detailed comparison of the languages of interface for the Web for more.

Dynamic Web pages

They integrate JavaScript code which allows an user interaction, and can modify the contents and the appearance of the page.
If one wants to add also an interaction with the server, to retrieve data to display or for updating the page, Ajax will be used, that is still Javascript, but supplemented by the XMLHttpRequest object for exchanges with the server.
Many frameworks are available which offers graphic components to create online applications. They suffer from an extreme slowness. The release of a compiled solution in XAML should solve the problem of the graphic user interface, see below.

Languages of the server

On the server, one uses scripting languages for a simpler programming, as they use few resource and offer a huge library of functions. These programs are embedded in the pages, their displays become part of the page and they access its contents by the Document Object Model. The code is executed on the server before the sending of the HTML page and then it disappears from it.
The main languages are PHP, running on all platforms and provided by all shared Web hostings, ASP under .NET, and JSP in Java.

The user interface

It is now designed in XML with the generalized use of tags to describe the interface: XUL, XAML, MXML, XForm.
With the XAML format and the environment that Microsoft is deploying, the company has taken an option on the future of markup interfaces.
While XUL is not able to provide a complete documentation on a very difficult to implement system, and that after years of existence it has no serious development tool, Microsoft attacks on all fronts:
- XAML is a universal format usable for data and code.
- The environments of development exist: Visual Studio standard or the free Express version, and a specialized XAML designer, Expression .
- A cross-browsers plugin is offered, Silverlight, running on Firefox, the competitor browser based on XUL!
- Documentation on the site of Microsoft, plus a Web site dedicated to Silverlight.

About other formats, XForm is not very popular and specialized in online forms, MXML is confined to Web applications. Difficult to implement, open source tools are promised by the editor, for the future. Glade, the development tool of Linux has also its own markup language.

Web services

They are intended to let computers interoperables on a network. They are actually programs installed on a server and usable by Web pages. They imply a system of data storage and a protocol of communications between the server and the pages.

Storage

The MySQL databases are popular because they are free and run on all servers in combination with the PHP language in particular. A simplified and faster version, SQLite offers the means of using the database in a personal file, transferable from a site to another.
Alternatively, one can use XML as data format, it powers some content management systems.

Communication

The base of a service is the RPC (Remote Procedure Call). The exchange of documents on the Web is done with the SOAP protocol or REST architecture .
SOAP is a standard XML format. REST makes use of XML or JSON, it is often preferred to SOAP considered to be too heavy and complex.
Yahoo offers a quantity of Web services in the REST architecture, concerning search, traffic, cartography and that uses JSON code.
When a Web service returns a JSON document, that simplifies the programming because the data are then usable directly in Javascript. This is why Microsoft includes JSON Web Service in its Silverlight plug-in.

Mashup

Mashup is an emergent trend of the Web which consists in combining several Web services to create new applications. The service of cartography of Google is the more often used, it makes it possible to locate on a map, possibly in 3D, any kind of economic activities, in particular hiring of housing.
Google has created a space for users, MyMaps, which allows each one to create maps and to supplement them with texts and images.

The Ajax frameworks

Ajax is also a means of communication with the server, in the purpose of using data from the same site to create dynamic pages, possibly applications and in this case one will use a framework.
The goal of Ajax frameworks is to create the interface of applications with limited resources. They are written purely in Javascript or are supplemented with server-side scripts, to provide processing or to access a database.

Anaa is a very simple JavaScript framework which is appropriate for small applications. For more professional applications, Dojo, Rico, offer extended possibilities, and in particular widgets to create a graphic interface.
Dojo makes it possible to run a Web application offline, but that will become superfluous with Firefox 3 which offers this possibility natively, just as Silverlight.

At the time of the choice

Which language, which formats, which interface, and which framework, before starting an application, a complete choice of technologies has to be made.
An application would be perfect if it can run both on the Web, without anything to install, but moreover if it is frequently used, it should run also offline without the need to be connected to the Net.
Editors of environment try to create the perfect system which will allow all that, which places us in front of a plethora of solutions.
Mozilla provides XULRunner which makes it possible to run applications locally and on the Web with Firefox. Adobe produces Apollo for applications written in MXML and Flash, and Microsoft the Silverlight runtime with the development tool Expression among others.
Then which to choose? Perhaps this article and the links which it provides will help to solve the dilemma!

More information

(c) 2007-2010 Scriptol.com. All rights reserved.