Overview
GNU-Weblook is a JavaTM API that makes writing dynamic web pages
easier. The API defines a number of Java interfaces which allow
developers to extend their Java objects in such a way that they can specify
what the object will be on the browser (ie: a list of links, a form, etc...).
The API also provides extensions of PrintWriter which allow these
suitably extended objects to be output with a single cal to print().
The Writer applies a particular look and feel to your object.
The advantage of using the weblook API is that it is very efficient
with object creation. In the server side environment object creation is
the biggest single peformance problem, and outputing display code for a
language like HTML is often very heavey on object creation, think of all
those Strings! Weblook allows you to express a view of your business
data which can be used by the output stream to send HTML without object
creation. Most of the String objects used by weblook are static
and therefore don't create any request-phase objects.
Where does weblook fit in?
There are lots of different HTML builder systems. Here is what we think
is good about weblook:
-
the most efficient way of building HTML in a servlet
(lack of object creation causes less problems for garbage collectors)
-
easy to use for business object developers and servlet application designers
alike
-
provides a good seperation of roles
-
allows the business object designer AND the servlet designer to forget
about the target browser platform
(weblook could use an HTML stream, an XML stream or a variety of different
kinds of both, it doesn't matter)
-
allows the definition of a browser page to be expressed totally in code
Many other HTML builder systems have some of these features but the reason
we developed weblook is that none of these systems do everything that weblook
does and none of them do it as efficiently as weblook does.
You won't want to use weblook all the time but it works very well in
combination with template systems, for example JSP.
How to use the API
The class PersonRecord implements Form and Link.
This allows MyServlet, which creates a reference to PersonRecord,
to use the HTMLWriter on the HttpServletResponse OutputStream
to print PersonRecord objects as either links (which would probably
print a link with the name of the person as the anchor text) or as a form
(with the data of the PersonRecord as the form fields).
The developer of PersonRecord could also implement other weblook
interfaces to allow the PersonRecord to be printed as a list of
data fields.
GNU-Weblook in the Development Process
During development of a web based system a number of people get involved
in the project. GNU-Weblook is intended as a tool for developers building
business objects.
Here is how we invisage the development process
-
overall design: what are the objects in the system?
-
design of business objects
-
code business objects, caried out by an application programmer
-
browser design: how should the application be present on a browser
-
extend the business objects with GNU-Weblook to have a browser outputable
form, carried out by the application programmer
-
create the servlet to glue the business objects together, carried out by
specialist web developer
-
fine design: look and feel, possibly extend the HTMLWriter to provide a
different look and feel for a particular element, carried out by specialist
Java programmer.
Future Development
We hope to extend the number of objects that weblook understands. We try
to make these fairly high-level abstractions (eg: list, form). We are hoping
that in the near future we will have extensions of many of the current
objects to allow slightly different interpretations within the base output
writer.
We are also hoping to increase the languages which can be used to build
weblook objects, this is a companion project with our efforts to make GNUJSP
scripting possible in Scheme and ECMAScript.
We are trying to build weblook in such a way that it fits in well with
template based systems like JSP.
Helping Out
Weblook is very definitely a work in progress. Please give us a hand if
you have any ideas.
Further Information
The JavaDoc for the GNU-Weblook API is available on line or as a download.
GNU-Weblook API JavaDoc on-line
GNU-Weblook API JavaDoc download (.jar file)
The GNU-Paperclips list is used by the developers working on GNU-Weblook.
You can register on the list by sending email to gnupaperclips@gnu.org.
Make sure that the subject contains the word: subscribe
Downloading the API
You can download the GNU-Weblook API class files by clicking on this link.
You can download the GNU-Weblook API source files by clicking on this
link.
The source files are also available from anonymous CVS from here.
| Created: 1 July 1999 |
Last Updated: |
Contact: webmaster |
Author: Nic Ferrier |