DForms is a technology that helps in creation of web based forms. It may be difficult at first to grasp what DForms is. The following chapters provide a short description of DForms features, comparison with other presentation technologies. Let's start with what DForms does and and doesn't.
Clean design – DForms are designed to fit into view layer of MVC pattern, with weak dependencies to the other layers. DForms are extensible, customizable and platform neutral (You can use Java, .Not, PHP or any other technology as backend).
Well defined roles – the roles specify the developer responsibilities and his/her necessary knowledge.
Component library – contains large library of ready-to-use leaf components.
Form layout – contains large library of ready-to-use panels responsible for layout.
Form decomposition – allows decomposition of screen into custom components.
Validation – out of the box client-side and support for server-side validation.
Output markup generation – by default, DForms output form as XHTML fragment. Output markup, however, can be easily changed to any other markup language.
Production ready – already deployed and tested in many real world projects.
LGPL licensing
Page flow - DForms is technology designed to render a form within a page. Controlling the flow of pages is responsibility of the standalone component – Controller (Controller layer in MVC pattern).
Data representation and access - DForms abstracts from the way the data are represented and accessed. Dealing with data representation and access is typically responsibility of another MVC layer – Model.
AJAX – DForms does not deal with UI changes once the form is rendered. However, one can create custom components, which use JavaScript, an AJAX framework, or even Flash to handle complex UI interactions.
Business specific interactions – DForms does not know about needs specific to your business. Thus for instance, it will not render a text box green because you have written 'grass' into it. It is your responsibility, and DForms provide means to do so.
Without knowledge of the other technologies, it may be difficult to understand the essence DForms. Table 1 compares DForms with other popular presentation technologies.
Table 1: Comparison with other form technologies
|
|
DForms |
XForms |
JSP Tags |
JSF |
|---|---|---|---|---|
|
Client-side mode |
✓ |
? |
|
|
|
Server-side mode |
✓ |
✓ |
✓ |
✓ |
|
Presentation components |
✓ |
✓ |
✓ |
✓ |
|
Form layout |
✓ |
|
✓ |
? |
|
Decomposition |
✓ |
|
✓ |
✓ |
|
Localization |
✓ |
✓ |
✓ |
✓ |
|
Validation |
✓ |
✓ |
✓ |
✓ |
|
Output markup |
✓ |
|
✓ |
✓ |
|
AJAX |
|
|
|
|
|
MVC dependencies |
|
|
MC |
MC2 |
|
Platform neutrality |
✓ |
✓ |
|
|
DForms is most similar to XForms and XUL. It has, however, several advantages. In comparison with XForms, it offers components to layout other components, supports form decomposition, and, in client-side mode, “runs” on existing clients. The major “functional” difference between DForms and XUL is IE support.
In the simplest scenario you need only text editor and browser. Unzip the distribution and open one of the descriptors from the samples directory in your browser. DForms does not require installation of any server-side component. Recommended browser is Firefox (with security.fileuri.strict_origin_policy=false in Fx3 about:config).
Source 1 displays descriptor of a very simple form.
|
<?xml-stylesheet type="text/xsl" href="../descriptor.xsl"?> <d:form namespace="ns1234" d:version="1.0" xmlns:d="http://www.dforms.org/1.0"> <d:metadata> <d:panel display-as="dforms-p-ybox"> <d:item display-as="dforms-e-text"> <d:ref select="/message"/> </d:item> </d:panel> </d:metadata> <d:data> <message xmlns="http://my.custom.data">Hello world!</message> </d:data> </d:form> |
Source 1: helloWorld.xml
The descriptor is a XML file with two main sections. Metadata section describes how the resulting form should look. Data section contains marshalled data. The xml-stylesheet processing instruction at the first line is responsible for transformation into XHTML result.
Source 2 displays the result.
|
|
Source 2: Hello World output.
Figure 1 displays DForms architecture. DForms consist of images, JavaScripts, CSS files, and

Figure
1: DForms Architecture
XSLT stylesheets, which do the descriptor
transformation. A form developer typically creates form descriptor.
The descriptor is a XML file with xml-stylesheet
processing instruction pointing to the “root”
XSLT stylesheet. The “root” stylesheet references all
other stylesheets from the library of presentation components (render
kit).
The transformation of the form descriptor into output is job of XSLT Engine. DForms supports two processing modes – client, and server side. In the server side mode, the transformation is performed on the server and client gets directly the resulting XHTML. In the client side mode, the client gets form descriptor and the transformation is performed by XSLT engine of the client.
Output XHTML references CSS files, images, and JavaScripts from render kit.
I theory, DForms can be used with any engine with XSLT 1.0 support. In practice, XSLT engines have bugs. DForms is tested on the following XSLT Engines:
Server-Side
Interpreted (XALAN)
XSLTC (XALAN)
Client-Side
Firefox
IE 6 (and above)
Figure 2 displays developer roles.

Figure
2: Developer roles.
Creates form descriptor and defines:
presentation structure
layout
localization
data binding
validation data
Uses XML Editor + Browser
Required knowledge XML, DForms
maintains library of presentation components
creates and maintains project specific extensions
supports Form designer
creates and maintains documentation
Required knowledge: XML, XSLT, XHTML, CSS, JavaScript, XInclude