Unlike an HTML page, which is a renderable unit, a VoiceXML document may contain several interactable units such as forms, menus, etc. While you could go to extremes and either write your entire VoiceXML application in a single VoiceXML document or have a separate document for each menu or form, most VoiceXML applications will consist of dialogs and supporting code grouped together into a number of files. For example:
There are no firm rules for deciding how to group dialogs; however, careful consideration of the following issues can help you decide:
For example, you might decide to use a separate VoiceXML document for a form or menu that is executed infrequently and contains a large grammar or references large grammar or audio files. This design will allow the large files to be downloaded only when needed.
Similarly, you might decompose a complex dialog sequence into a series of subdialogs. Subdialogs are also useful for creating reusable components.