| home / programming / awxml3 / 1 | [previous] |
|
|
We conclude this chapter with a summary of XForms features and highlight the consequent benefits over using traditional HTML forms for developing Web applications. A key differentiator when using XForms is the separation of purpose from presentation. The purpose of the questionnaire application is to collect information about the user. This is realized by creating a presentation that allows the user to provide the required information. Web applications typically render such a presentation as an interactive document that is continuously updated during user interaction. By separating the purpose from its presentation, XForms enables the binding of different interactions to a single model. In practice, this enables the application developer to deploy user interfaces that are appropriate to the target audience without having to create custom software components for processing the data collected via each distinct user interaction. Finally, by using structured XML to collect, validate, and communicate data, XForms processors can provide these functions to the Web developer as part of a standard XForms service.
| Declarative | Declarative authoring makes XForms applications easier to maintain. |
| Strong typing | Submitted data is strongly typed and can be checked using off-the-shelf XML Schema tools. Strong typing also enables automatic client-side validation. As an example, a native XForms browser can use these types of constraints for validating user input; when serving the same XForms document to a legacy browser, these constraints can be used to generate client-side Javascript automatically. |
| Schema reuse | XForms enables the developer to reuse business rules encapsulated in XML Schemas. This obviates duplication and ensures that a change in the underlying business logic does not require reauthoring validation constraints at multiple layers of the Web application. |
| Schema augmentation | This enables the XForms author to go beyond the basic set of constraints available from the underlying business application. Providing such additional constraints as part of the XForms Model enhances the overall usability of the resulting Web application. |
| XML submission | This obviates the need for custom server-side logic to marshal the submitted data to the business application. |
| Internationalization | Using XML 1.0 for serializing data ensures that the submitted data is internationalization ready. |
| Accessibility | User interface controls encapsulate all relevant metadata such as labels, thereby enhancing accessibility of the application when using different modalities; as an example, a nonvisual client can speak relevant information when navigating through an XForms user interface. |
| Device independence | Abstract user interface controls lead to intent-based authoring of the user interface; this makes it possible to deliver the XForms application to different devices. Thus, Web pages authored using XForms can be deployed to a range of accessing devices including desktop browsers, PDAs, and cell phones with small displays. |
| Localization | Labels and help text can be referenced via URIs, thereby making it possible to localize XForms user interfaces. |
| Actions | XForms defines declarative XML event handlers such as ~setfocus~ and ~setvalue~ to obviate the most common use of scripting in Web applications. Consequently, most XForms applications can be statically analyzed; contrast this with the use of imperative scripts for event handlers. |
1.5 XForms at a Glance
Table 1.1 shows the various XForms components at a glance; this also serves as a road map for the rest of this book. For each component, we enumerate its role in the XForms architecture, the underlying technology used by the component, and its concomitant benefits.
Table 1.1. XForms at a Glance
| Component | Description |
| Model | • Encapsulates all data aspects of a form • Uses XML Schema to define constraints • Uses XPath to define model properties • Attaches model properties to instance nodes • Captures what, how, and where to submit |
| Properties | • Capture application constraints • Enable reactive user interfaces |
| UI Binding | • Connects user interface to the model using XPath |
| UI Controls | • Collect user input • Bind to underlying model • Encapsulate all relevant metadata • Access by design • Encourage device independence |
| UI | • Aggregates user interface controls • Encourages intent-based authoring • Creates dynamic user interaction |
| Events | • Bring user interface to life • Give access to eventing via XML Events • Attach dynamic behavior • Obviate common use of scripts via declarative actions |
| home / programming / awxml3 / 1 | [previous] |
Created: March 27, 2003
Revised: January 2, 2004
URL: http://webreference.com/programming/awxml3/