ASP Websites as Windows Applications    

 

 
(get PDF file of the article as it appeared in Software 2.0)

Intro

From time to time, authors of a programming language or programming paradigm announce a slogan: „write once, run anywhere”. With that loud slogan, in May of 1995, Java was introduced to the world of IT specialists. However, quite soon it was discovered that “running anywhere” was not that simple.

Certainly, most of the language constructions could even be the same for Windows application, applet for HTML page or servlet. But the fundamental environment differences of these platforms make it impossible to write an application and then, with no change to the source code – to publish it as a website. Some important code parts must be rewritten.

When we started creating ASPExplore, we did not intend to create a new language or paradigm. We contemplated a 100% realization of the slogan: „write once, run ...” – but not necessarily “anywhere”! It would satisfy us to run a code on just two of today’s widely used platforms:

  • on the Windows operating system - as an application
  • on a web server - as a website

“100%” means that without any single change to the source, the code should once appear as an EXE program and once as a website one.

Today we can surely claim that we successfully completed the task. We have created a code execution environment and a special “browser” capable of executing the scripts embedded in WWW pages (Microsoft ASP) without any web server!

We also created an application generator that takes an ASP-based website (a collection of hyperlinked ASP/HTML files) and builds an EXE application and its installation program. The resulting application runs and behaves as regular Windows program, but displays and performs in the same way as if it was a website! At www.aspexplore.com in “Samples” folder you may find several examples of applications and websites.

ASPexplore fulfills our vision of modern software, as the web-oriented, web-centric software. Unprecedented development of public Internet and thousands of corporate Intranets, push developers of applications ranging from scientific to business systems, to create them as “web applications”. There are many reasons for the trend, let us iterate through the most important of them:

Unmatchable features and richness of a user interface. Using DHTML/CSS or XML/XSLT with modern browser rendering engines it is possible to create a user interface (GUI) far richer than using standard programming tools. The possibility of using client-side components (like FLASH or some ActiveX controls) makes the interface an unsurpassable tool.

  • Provided there is a network, Web application, once written, can run using a regular Web browser on any computer without additional installations.
  • Web applications are created using a client-server paradigm what allows for creation of large integrated systems, with central database under the hood, easily accessible from any distributed locations of a company, corporation etc.
  • Programming languages used for creating Web applications are very easy to learn as in the most cases they are scripting languages. Sometimes (C#, Java) they are just-in-time compiled languages having strong object-oriented features. Both families are strong tools for business applications.

However, there is an obstacle in the distribution and access to web applications – the author has to assume the unceasing and uninterrupted network link between the client and the application’s server. This is not always guaranteed.

To overcome the problem, a workstation could have a web server, and then the web application installed on top of it. But this creates a burden on workstation resources and installation problems as web servers are generally quite heavy components. Distribution of web applications is hence not easy.

Nevertheless, we assert that web applications are far better than classical apps – but – they do not need to act in network environment!

With this controversial proposition we come to the essence of what ASPexplore is.

How does ASPexplore work?

ASPexplore contains two basic programs:

  • ASP browser – a browser that can render both HTML and ASP pages/scripts
  • Setup maker – an application EXE file and setup generator

The ASP browser is a helper application for ASP programmer. Its operation is very simple – much the same as a web browser opens and renders HTML pages, the ASP browser opens and executes ASP pages!

How does it happen? ASPExplore reads an ASP page and converts it on-the-fly to script, which is being executed by a system’s script interpreter (Windows Script Host). In turn, the script generates the output stream (HTML or XML) which is send to a browser component embedded in ASPexplore for rendering.

Using ASPExplore one can “execute” ASP pages without any server. As the system supports all ASP objects (session, request, response etc), we get the pages execution identical to that of the web server like IIS.

ASPExplore operations rely on Windows’ Asynchronous Pluggable Protocols infrastructure. Using it, ASPExplore supports both local and network domains without using HTTP network protocol. ASPExplore is a fast multithreading system – execution is faster than that of a web server.

What is even more exciting, is the fact, that the same collection of ASP files can, simultaneously, be a Windows app and a website! This realizes the scenario where a local user interacts with an application while another remote user accesses it from the web!

Setup Maker – a wizard

The role of Setup Maker is to take a collection of ASP/HTML pages and create a single EXE application that represents the “site” with the installation program. Acting as a wizard, Setup Maker generates the single output file, packing and compressing all pages, images, components into a single executable for easy distribution.

Current and future use

MakoLab has successfully used ASPExplore to construct a distributed ERP-class sales support system for a corporation with more than 300 sales outposts in Poland.
In other applications ASPExplore customers have created a number of interactive, database driven catalogues distributed on CDs. Some electronic catalogues of the very large international corporation are being created with the use of ASPExplore. For the corporate customers, the main benefit was the identity of appearance of the CD based catalogue and the catalogue website.

While I’m writing these words we work on an extension of our idea so that it can embrace ASP.NET technology and potentially PHP. We will write about that soon....