User's Manual

Chapter 8.
WAF Application Development Tutorial
This tutorial introduces the concepts and techniques needed to create your own application in the Red
Hat Web Application Framework. It describes how to define the application so that it can be packaged
and installed wherever the WAF platform is installed.
8.1. Terms and Assumptions
In addition to the the assumptions in Section 1 Assumptions About WAF Developers (e.g. that you have
a working understanding of object-oriented programming in Java, the Servlet API, relational schema
design, XSLT, and CSS), you should understand the WAF kernel API.
Application
A bundle of data and UI logic that is reachable via the web. Refer to Chapter 6 WAF Component:
Web.
Servlet
Code to handle a web request using the J2EE Servlet API. Throughout this document, we
assume you are familiar with version 2.3 or later of the Servlet specification. Refer to
http://jcp.org/aboutJava/communityprocess/first/jsr053/index.html.
Webapp
A web application package designed for deployment in a servlet container. A webapp instance
corresponds to a ServletContext. A WAF webapp will typically contain one Application.
PDL
The Persistence Definition Language, used to define object types in the WAF persistence layer.
Refer to Chapter 2 WAF Component: Persistence and Appendix D PDL Syntax.
8.2. Good Practices
One goal of this tutorial is to help you design an application that:
Uses sound patterns when integrating with WAF services.
Can be packaged and installed cleanly in environments other than your own.
One important consideration in developing your own application is namespace. It’s important to
pick a well-qualified name for the domain of your application and then to use this qualifier uni-
formly throughout your code. For the sample application we develop in this guide, we always use the
com.example.binder namespace for our PDL, Java, and other resource files.
There will be comments along the way telling you how to avoid pitfalls and where to take extra care.
8.3. Directories in the Work Area
When your webapp is complete, the packaging of the source and distribution archive depends on a
canonical layout of directories and files. This section discusses where to put them in order to create
portable, standard packages.