Jasper framework
Encyclopedia
The Jasper framework is an open source, cross platform web development framework. It is often simply referred to as Jasper.

Preliminary definitions

Because Jasper supports several languages and platforms, some definitions are helpful in understanding its description. In Jasper parlance, a web interface provides the functionality to enable code running on a web server to be both referenced by a web client (usually a browser) via a URL, and to communicate its response. Common web interfaces are the CGI
Common Gateway Interface
The Common Gateway Interface is a standard method for web servers software to delegate the generation of web pages to executable files...

 interface, Sun's Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

 servlets model and Microsoft's ASP.NET
ASP.NET
ASP.NET is a Web application framework developed and marketed by Microsoft to allow programmers to build dynamic Web sites, Web applications and Web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages ...

 framework. The last example in fact encompasses far more than a web interface, but this functionality is virtually all that the Jasper framework requires. A web platform is defined as a combination of programming language and web interface. C#/ASP.NET, for example, or Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...

/CGI. A web framework is defined as a system that enables the generation of dynamic web content. In this sense, the Jasper framework is a web framework but not a web platform.

Description

Jasper currently supports (or can be said to be supported by) four web platforms. They are:
  • Perl/CGI
  • PHP
    PHP
    PHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document...

    /CGI
  • C#/ASP.NET
  • Java/servlets


Such is Jasper's generality that it could support many other web platforms.

In essence, Jasper is a template engine. It works by replacing instances of tokens with the appropriate content both in plain text template files, usually HTML files, and list files. The latter are used primarily to generate query strings, the part of URLs occurring after the question mark. To this end, Jasper employs five template classes to process template and list files, organised in a template class hierarchy that can be easily extended to process custom tokens. Tokens processed by default consist of those whose contents match the names of form
Form (web)
A webform on a web page allows a user to enter data that is sent to a server for processing. Webforms resemble paper or database forms because internet users fill out the forms using checkboxes, radio buttons, or text fields...

 variables, configuration variables, or temporary variables, in each case the token is replaced with the associated value of the variable in question. These three types of variables are stored in an associative array
Associative array
In computer science, an associative array is an abstract data type composed of a collection of pairs, such that each possible key appears at most once in the collection....

, called the global properties array. Form and configuration variables are added to this array at inception by methods of the Form and Config classes which, together with the template classes, comprise Jasper's core. Temporary variables are so named because they are added to the global properties array directly in the code, and are removed immediately they are no longer needed, to keep the size of this array to a minimum.

A mathematical basis

Such is Jasper's simplicity (its core classes are typically implemented with only a few dozen lines of code regardless of platform) that its workings can be completely described by Hoare logic
Hoare logic
Hoare logic is a formal system with a set of logical rules for reasoning rigorously about the correctness of computer programs. It was proposed in 1969 by the British computer scientist and logician C. A. R. Hoare, and subsequently refined by Hoare and other researchers...

 with only minimal extensions. The global properties array provides the state of the web application
Web application
A web application is an application that is accessed over a network such as the Internet or an intranet. The term may also mean a computer software application that is coded in a browser-supported language and reliant on a common web browser to render the application executable.Web applications are...

 from its inception to the communication of its generated content and its subsequent destruction. By this means, both the workings of the web application during the course of a single HTTP response, and the progression of the state of the web application during a session of several pairs of requests and responses (for example, which page is being shown, or which form fields have been validated), can be formally specified. In this sense it contrasts sharply with other web frameworks, whose relative complexity make formal reasoning a practical impossibility.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK