However, with the judicious use of techniques I described in my InformIT article Optimized Presentation of XML Content, you can get both views of the application from the same server-side transactions:
- All server transactions should generate XML output (even when they report errors), so their results will be immediately usable by the client-side AJAX code.
- For visitors not using the AJAX version of the application, the XML output should be transformed into HTML on the server using an XSLT transformation. The transformed HTML text should include links to other transactions so the non-AJAX-capable visitors can still explore most of the functionality offered by your application.
- The design and development process that you can use with HIJAX thus includes the following steps:
- In the application design phase, identify all transactions that have to be executed on the server.
- Design the output format (XML schema) returned by each transaction. The output should include enough data to be self-sufficient when presented to the non-AJAX end user.
- Ensure that all server-side transactions return their results (including error messages and status codes) in XML format.
At this point in the development process you can test isolated transactions, inspect the XML output they generate and verify their correctness. After the transactions have been validated, develop the client-side part of the application:
- Develop the XSLT transformations for each transaction and the CSS style sheet to support the resulting HTML markup.
- Test the HTML markup produced by individual isolated transactions.
- Test the whole application (in particular, the interaction between the transactions) in the HTML rendering.