Wing+ Web-Application Development Framework
Wing+ Web-Application Development Framework
6, November 2011
ABSTRACT
Nowadays web development has been expanded greatly, not only for ordinary reasons, but also for enterprise and other important purposes. So its obvious that there would be some challenges and problems if you want to develop important applications such as an automation system on the web. Some of the problems that Ive encountered myself as a software developer group manager are source code safety, high performance rate at runtime, optimum resource usage and the ability to customize some essential parts of application that are not allowed or their source code is not available. In this document a new web programming framework called Wing+ will be introduced to you, that is designed to resolve these issues and so many other problems that are out of the scope of this paper.
KEYWORDS
C++ Web Framework, Source Code Safety, Modular System, Optimum Resource Usage, High Performance
1. INTRODUCTION
There are some issues that seem to still not have been resolved in a remarkable way. The basic motivation for designing and introducing the Wing+ framework is a result of encountering these problems. I am going to clarify these problems for you to have a better understanding of what this document is going to concentrate on.
1.1 Motivation
Source Code Safety: Do you install your web application on your own server or do you buy it from a hosting provider? If youre planning to implement a web-based automation system for another company, where do you setup their system (in most cases on the companys computers)? If you use your own server, can you ensure its source code safety versus the hackers? Sometimes you need a very high performance rate and the least runtime to do some tasks online. Unfortunately most of the web programming languages and frameworks are not fast enough and optimum to do some of these heavy tasks as you will see later. Ill give an example from my own experience when I decided to convert my Windows based OCR (Optical Character Recognition) software to a web-based one, I figured out that I need a very expensive set of servers called cluster, because the language I used to write my web program was so slow in comparison to the one I wrote the Windows based software.
DOI : 10.5121/ijdps.2011.2616
179
International Journal of Distributed and Parallel Systems (IJDPS) Vol.2, No.6, November 2011
In my opinion it is very hard to manipulate some essential parts of a web application such as a Session Manager or the Server Interface, when you need to fully customize them. So instead we should try and look at other possibilities and ways for improvement. It seems that common web programming languages do almost everything themselves, so when you need to do something more exclusive and professional, its better to look for specialized methods instead of using predefined and automated tools, so you can optimize you performance.
Measures have been taken in this regard such as CSP [1] and Wt [2] frameworks. However they have tried to resolve the preceding problems, it seems that they did not do good at all of the mentioned issues, as it will be discussed in parts 2 and 5.4 of this paper. This document introduces a new web application development framework and even maybe a new programming language that tries to resolve the mentioned issues, with more concentration on source code safety and performance. Hackers can steal your source code easily by intruding into your server. For instance this could be achieved by uploading a script on the server and manipulating the remote share settings, and so its possible to gain file system access, or for someone to steal your session while you are working on your server through the host panel software, then the intruder can gain access to your files and so many other possibilities [3]. Wing+ is designed for creating web applications which require source code security, high performance rate at runtime, simple customisability and efficient resource usage to lower the costs of hardware which is needed. There are two essential ideas that helped me to overcome the introduced problems. Choosing an appropriate programming language that provides the basics of high performance and source code security, and designing a highly flexible and customizable API that covers the last two problems were the keys which helped turn Wing+ into what it is today.
There are two approaches to designing web pages. First, you can implement a response handler class and create your pages like you did for Windows based forms. The second approach that is more familiar to web developers is to use Wing+ blend markup language that is a mixture of HTML, C++ codes and Wing+ components. The second approach splits the designers and programmers jobs and makes development processes more structured
180
International Journal of Distributed and Parallel Systems (IJDPS) Vol.2, No.6, November 2011
but the first one is more flexible. Both of these designing methods are available in Wing+ and theres no limitation. Wing+ provides a very simple approach for the programmer to create data entities in different scopes such requests, applications and sessions and an easy way for designer to bind these entities to the components. Component module implementation has made it possible to create your own tags for the blend markup design method and widgets for the class based design method. All parts of the application are in the form of modules and you can dynamically add modules to your program while it is running, and so the application will be in full control.
This article consists of 6 essential sections that try to illustrate how these benefits are made available in Wing+. Section 2 is an introduction to related works and their features, section 3 and 4 will describe the architecture of Wing+ and its basic concepts, and whats found in the 5th section is an assessment of Wing+ and other frameworks proving that Wing+ resolves the preceding problems in a remarkable approach.
2. RELATED WORKS
Whats found in this section is an introduction to CSP [1] and Wt [2] frameworks. They follow the mentioned motivations but here are some essential differences such as selecting the appropriate API and flexible structure which leads to poor customizability.
International Journal of Distributed and Parallel Systems (IJDPS) Vol.2, No.6, November 2011
simple with Wt would require an impractical amount of effort otherwise: switching widgets using animations, while being perfectly indexed by search robots with clean URLs, or having a persistent chat widget open throughout, that even works in legacy browsers like Microsoft Internet Explorer 6. The library comes with an application server that acts as a stand-alone Http(s)/WebSockets server or integrates through FastCGI with other web servers.It does not support the page based development that is familiar to web developers and is suggested to Windows developers who want to migrate their application simply to a Web-based one.
3. WING+ ARCHITECTURE
Wing+ is based on modules. In order to create an application the programmer should implement some modules which may include pages, pipeline filters, and business logic entities and so on. This can be achieved by coping the binary files of modules into the applications lib or bin folder or by placing their source code inside the src folder. If you put source codes inside the src directory of the application you are deploying, they will be compiled automatically by the application itself according to the host architecture, so there is no need to worry about its portability. Wing+ needed to be based on an appropriate programming language which is fast, efficient, reliable and familiar to the programmers community. I selected C++ for many reasons which will be described in the following section.
International Journal of Distributed and Parallel Systems (IJDPS) Vol.2, No.6, November 2011
(.EXE and .DLL) files from intermediate language (IL, CIL, MSIL) binary formats to the high level code that applies to Microsoft .Net languages (such as C#.NET) [5]. C++ supports all of the 5 programming models such as object oriented [4] so it should be very convenient. Unlike other Microsoft .NET languages, C++ is cross-platform and as a result you will see that wing+ can be used in both Linux and Win32 platforms.
International Journal of Distributed and Parallel Systems (IJDPS) Vol.2, No.6, November 2011
3.3.1 Driver
The Driver is the start point of an application and can be either a stand-alone container server, embedded server or a module written for another server application such as Apache or IIS. The Implementation of HTTP request and response objects also must be done in this module. The descriptor XML file of each Wing+ application will tell the driver of other modules that should be loaded. Therefore every module that you want to implement yourself can be attached to the application by a simple definition done inside the descriptor. Another reason for attending this part to the API as an implementable module was to make any kind of request serving available. If you do not trust the Wing+ embedded server driver, you can change your driver to the Apache server module and benefit from its great thread-pooling and other special facilities. This depends on the Wing+ driver package you install on your host computer. However the embedded server that is designed for Wing+ is an experimental one, but the load impact test results that compares the Apache Tomcat web server with Wing+ embedded server shows that it is very reliable. The test specifications are: Testing Tool: Jakarta JMeter 2.4 (Apache foundation product) Number of parallel users: 250 Number of WPP/JSP pages: 10 Number of requests for each page: 180 Total requests: 450,000 Table 1. Wing+ embedded server versus Apache Tomcat server
No. of Generated Responses Median Response Time (ms) Average Response Time (ms) Minimum Response Time (ms) Maximum Response Time (ms) Std. Dev. Elapsed Time (s) Memory Usage
240
36.5
116
468 KB 668.2 MB
12
3049
105.5
101
Response time and throughput for both of them is somehow the same, but memory usage of Wing+ embedded-server is significantly more efficient than the Apache Tomcat Server.
3.3.2 WP-Application
This part enables the programmer to share data among all of modules in a very simple approach. A pointer of this module will be sent for all other modules in order to make global data (Application Scope) available all over the program. Dynamic module loading can be done through this module too. Programmer is allowed to implement this module again in order to change the way of data sharing throughout the application.
International Journal of Distributed and Parallel Systems (IJDPS) Vol.2, No.6, November 2011
3.3.6 Logger
This module can be called from everywhere inside the application in order to write events down. You can implement this part to classify different messages and store them on a simple file or on the database.
185
International Journal of Distributed and Parallel Systems (IJDPS) Vol.2, No.6, November 2011
Request and Response objects are actually those defined by the driver module. All dynamic resources in a Wing+ application are response handlers.
3.4.2 Filter
If some security measures or other kinds of checkups are required before the request reaches the static or dynamic resources, a filter must be defined in order to handle the checkup. By overriding the doFilter function of this module it is possible to check the request and make a decision to let it continue its way through the pipeline or to ban it. It is possible to chain the filters together by assigning them a priority number. By doing this, the clients request will reach the filter with the least priority index and afterwards if the current filter authorizes the request; it will reach the next filter and so on until being banned or reaching the specified resource.
4. WING+ PAGES
The main concept which brought me to think about Wing+ pages (.WPP) were the events that occurred inside the Java [7] .The relationship between Wing+ pages and response handlers is exactly the same as the relationship that is between Java Servlets and .JSP files. Each .WPP file is converted into a response handler module at the programs startup and then all of them will be compiled (using GNU compilers, g++ for Linux and MinGW for Win32) and linked in a single module named default application module. After the first execution, you can remove all the .WPP files from your host in order to keep them safe from hackers or source code thefts. This is exactly what you do with other module source codes, since .WPP files are modules as well. The .WPP compiler is an embedded part of Wing+ main library and if you want to implement the driver or application module yourself, there is no need to write a compiler for this reason. WPP syntax is a mixture of HTML, C++ codes, Wing+ Components and directives. The directives do
186
International Journal of Distributed and Parallel Systems (IJDPS) Vol.2, No.6, November 2011
some pre-compile tasks such as making components and entities available throughout the WPP page, binding variables and methods defined inside a particular entity to the components and so on.
regex-dna k-nucleotide[7] binary-trees Mandlebrot[8] reverse complement Pidgits[9] fannkuch-redux[10] n-body[11] spectral norm[12]
International Journal of Distributed and Parallel Systems (IJDPS) Vol.2, No.6, November 2011
5.3. Deduction
The following chart indicates the average runtime and memory usage for each programming language that take part in the two previous tests. There are two columns for every item, in which the first column represents the runtime and the second one shows the memory usage in scale of megabytes.
Blend Markup & Script Based Design Class (Widget) Based Design User Defined Components Pipeline Filtering Operating System Custom& User Defined Server Custom Session Manager Custom Application Manager Custom Authentication Manager Automatic Scoped Entity
International Journal of Distributed and Parallel Systems (IJDPS) Vol.2, No.6, November 2011
Management Rich HTML Components Dynamic Module Load Fully Source Code Independent Run
NO YES YES
NO NO NO
YES NO YES
However Wing+ is newer than the afore mentioned frameworks and so its components and predefined tools will probably need some expanding, but it has the basic ones and enables programmers to design everything that they will need. As I mentioned in the previous sections, everything in Wing+ is defined as an implementable module in order to be fully customizable, so there is no need to worry about the predefined facilities. For the time being Wing+ is in the experimental level of development. In the next releases the number and quality of Wing+ predefined components will be increased in order to satisfy its users.
6. CONCLUSIONS
As its mentioned before, there are some issues and problems that a Web developer team would encounter if they tend to implement a Web-based system that do heavy tasks in point of the server side processes or that is an enterprise software in which its source code may be valuable for many other people. In most of Web programming languages its so easy to decompile binary codes into the desired source code because of the nature of those languages [14]. Therefore high performance rate at runtime and source code safety will become subjects to think about. On the other hand if tasks associated with an application consume system resources a lot, so the overhead of the Web-Application itself must be the least to decrease the resource usage and consequently to lower down the hardware costs. So the other problem is efficient resource usage. Another subject is how much you are able to customize the essential parts of your application such as Session Manager or Server and so on. Wing+, the introduced new framework is designed to resolve this type of subjects. It is based on the power of C++ programming language and a flexible API that is fully customizable. The use of C++ helps developers to ensure of their source code safety because of its compilation method [14] and take advantage of the other facilities that brought with C++ such as a great runtime performance and numerous libraries compatible with C++. Some benchmark algorithms have been tested and executed on Wing+ and some other Web development programming languages to prove the advantage of Wing+ over the other Web development tools in point of runtime performance and efficient resource usage. Another benefit that comes with Wing+ is its modular architecture nature that enables users to customize their applications easily in every level they need without knowing anything about the default implementation and source code of the Wing+.
REFERENCES
[1] [2] [3] [4] [5] Micronova companys official web site, www.micronova.com/CSP.html Witty official web site: www.webtoolkit.eu/ Rohas, Nagpal, (Jun 2010) Source Code Theft &the Law, Club Hack Magazine Deitel&Deitel, (2005) C++ how to program, 5th edition Salamander decompiler web site, www.remotesoft.com/salamander 189
International Journal of Distributed and Parallel Systems (IJDPS) Vol.2, No.6, November 2011 [6] [7] [8] [9] [10] [11] [12] [13] [14] Luke, Murphey, (2005) Secure Session Management: Preventing Security Voids in Web Applications, SANS Institute Simon, Brown & Sam, Dalton, (2005) The Experts Voice in Java Pro JSP 2, 4th edition, Apress publications, Chapter 3 Vicente, Arnau& Ignacio, Marin, "A Fast Algorithm for the Exhaustive Analysis of 12Nucleotide-Long DNASequences. Applications to Human Genomics." Eric, W. Weisstein, "Mandelbrot Set." From MathWorld--A Wolfram Web Resource, http://mathworld.wolfram.com/ Eric, W. Weisstein, "Pi Digits." From http://mathworld.wolfram.com/PiDigits.html MathWorld--A Wolfram Web Resource,
Robert, Sedgewlck, (2008) "Permutation Generation Methods", pp150-151 Diacu, F., (1996) "The Mathematical Intelligencer", the solution of the n-body Problem, pp66 70 Eric, W. Weisstein, (2002) "Hundred-Dollar, Hundred-Digit Challenge Problems", challenge #3 Spectral Norm Short, Christopher, (2011) Source Code Revelation Vulnerabilities 6th edition, SANS Institute
Authors Ahmad Golchin He was born in 1990 and began computer programming in 1999 using Microsoft QBasic, and now he knows how to program in many other languages such as Assembly, C, C++, Java, Pascal, ASP, PHP, Ruby, VB.net, and C#.net. Database Administration, Digital Image Processing, Neural Networks methods and Internet Computing issues are some of his best proficiencies. Now he is studying computer engineering final year in Sheikhbahaee university of Isfahan.
Ahmad Baraani Ahmad Baraani-Dastjerdi is an associate professor of computer engineering at the Faculty of Engineering of the University of Isfahan (UI). He got his BS in Statistics and Computing in 1977. He got his MS & PhD degrees in Computer Science from George Washington University in 1979 & University of Wollongong in 1996, respectively. He is Head of the Research Department of the Communication systems and Information Security (CSIS). He co-authored three books in Persian and received an award of "the Best e-Commerce Iranian Journal Paper" (2005). Currently, he is teaching PhD and MS courses of Advance Topics in Database, Data Protection, Advance Databases, and Machining Learning. His research interests lie in Databases, Data security, Information Systems, e-Learning, e-Commerce, Security in e-Commerce, and Security in e-Learning.
190