The WOM language is an extension to HTML for writing interactive Web pages: it consists of standard HTML with some added commands and with the ability to include Object Rexx code inserts. WOM is a superset of HTML, and the simplest (non-interactive) WOM programs would be valid as HTML.
The WOM compiler reads WOM source files and compiles them to Object Rexx class definitions. Some simple WOM applications might have just one page, like the factorial one shown in Section 2.3. The page will be defined in its own source file, as though it were HTML.
Most non-toy applications, though, will contain several pages, plus one
higher-level ``root'' object that holds them and transfers control
between them as required. Tow, for example, has a number of different
pages, each with its own data form. With applications like this, the
Web-page author
needs to define not only the individual pages, but also the root.
WOM allows this to be done using the <Class>
construct
of Section 2.14. As with
the pages, the definition would go in a file of its own and would
compile into an Object Rexx class.
The above paragraph indicates that some files can define objects that
contain more one page. It is also possible with <Class>
to
define parts of a page. For example, you
could define a footer to be included in every page. However, whether or
not you use <Class>
, every file defines one and only
one object, and compiles into one Object Rexx class definition.
We see then that each application corresponds to a class. Each class has
an emit
method, generated by the compiler, which when called
emits its HTML representation down an output stream.
WOM comes with a run-time system, part of which is a top-level server
script. All class definitions must be available to this script when
it is running. To send back a page, the script breaks apart the incoming
URL, converting it into either a class name or the name of an existing
instance. If a class name, then the script creates a new instance
of the class, otherwise it locates an existing instance. It
then calls the instance's emit
method, and sends the resulting
HTML back to the user's browser.