NWS Tutorial

Why a new framework to develop web site in Java?



Fast access:
   The genesis
   The aimed objectives

The genesis

This project was born from a synthesis of the many existing systems of implementation of WEB applications. The report was without call: all the studied systems presented interesting ideas, but everyone stop without going at the bottom of the things. It appeared interesting for me to try to provide a new framework integrating a certain number of concepts and supporting an increased productivity (in term of time of development) but leaving side the negative points of certain solutions, and, in parallel, by injecting some new ideas making it possible to go even further.

As example, we consider the model of JSF pages (Java Server Faces, proposed by Sun Microsystems). Although it is very effective, it has some heavinesses. I think that the more blocking problem on this system is that JSF is an on-layer of the JSP model. However this one is very reducing if we consider the concept of WEB components. Indeed, in JSP, you can define your own libraries of tags (the famous taglibs): however even if the page contains several authorities of the same tag, only one and single Java authority (class javax.servlet.jsp.tagext.TagSupport) will make it possible to charge in memory the values of these tags attributes. It is complicated to consider a model of event-driven Web programming based on JSP, since a single authority of class of tag is recycled. JSF Circumvents the problem by adding the class concept of component. This class will be used to produce as many authorities as tags present in the Web page. But, to code a component JSF, it is necessary for you at least to code two classes (the class of tag and the class of component) and moreover, it will also be necessary for you to publish two files XML (the file .tld for the definition of the JSF tags library and the configuration file of the JSF controller (WEB-INF/faces-config.xml). It is very heavy, more especially as Java proposes the JavaBeans model!

On the contrary, the NWS framework enables you to develop a Web component while coding, normally, only one and single class. It is not necessary to define, by the means of a XML syntax, the list of the attributes supported by the XML tag: the JavaBeans model is enough amply! An attribute of the Web Page tag corresponds to a property (methods get/set) of your Web component class.

Another example: JSF, or ASP .NET (the Microsoft solution), allow to use a server component in a Web page, by using a XML tag : this one will be made up of two separated parts by a character ":". For example <h: outputText> or <asp: TextBox>. However to define the prefix (asp, h, or other) you should use one declaratory page (starting with <%@). However, this is or not, a XML namespace ?

NWS proposes, as for him, the use of the namespace and URI concepts (recommended, I point out it to you, by the W3C) to introduce the package into which the Java class associated with the XML tag, will be located. It appears clearly that the NWS framework (using the java programming language) is not rested on the JSP or JSF pages. Here you can find a small example.

 
01 <?xml version="1.0" encoding="ISO-8859-1" ?>
02 <web:Html xmlns:web="corelib.services.web.components"
03           codeBehind="corelib.services.web.samples.virtualcaddy.webpages.Login">
04 	<head>
05 		<title>Logon screen</title>
06 		<link rel="stylesheet" type="text/css" href="CssStyles.css" />
07 	</head>
08 	<body>
09 		<h1>Logon screen</h1> <br />
10 
11 		<web:Form focus="txtLogin" method="post">
12 			<div align="center">
13 				Login : <web:TextBox id="txtLogin" value="toto" />
14 				<web:RequiredValidator componentToValidate="txtLogin"
15 				    errorMessage="Value is required" cssClass="Validator" />
16 				<br/>
17 	
18 				. . .			
19 			</div>
20 		</web:Form>
21 	</body>
22 </web:Html>

The aimed objectives

The NWS Framework was developed (and will continue to be developed) while being focused on a principal objective: to guarantee the strongest productivity as possible (in term of development time) for the development teams. With this intention, all mechanism including an overcost in times of development will be avoided, even if this one could have guaranteed performances in more thorough execution time. The response time of the framework to build a HTML page, will not be the priority which will direct the concepts suggested by NWS. Nevertheless, all our attention will be related to the quality of the produced code to implement the various concepts suggested.

In this state of mind, the framework could have some changes of implementation. Any methods and classes could be removed from the framework. This will not be inevitably retained, for the profit of pure and simple modifications. The objective of this choice is to avoid a progressive limitation of the framework, which could make it obsolete in the long term. From this point of view, we can consider today that certain parts of the J2SE or J2EE are unsuited (because there is a problem of compatibility with the preceding versions). We will seek that this will not be the case for the NWS framework.

The javadocs proposed on this site as this tutorial will be permanently maintained at days in order to help you to benefit from all the innovations which are and which will be gradually brought to the framework.

Finally, you can note that the will of this framework will not be limited to provide solutions to the server side. A relatively rich Javascript library will enable you to consider the production of Web applications of a great visual richness (dynamic menu, tree structures, mitres...). Nevertheless this part of the framework will arrive in the second time.



CAUTION : NWS is proposed to you in BETA version to allow evaluation of this framework. Infini Software is released from any responsibility for the use of framework NWS. In addition, Infini Software can in no way be liable for the use of information contained in these tutorials.

Dominique LIARD - © 2007 SARL Infini Software - All rights reserved
Other brands and product names in these documents are the property of their respective owners.