Structuring an Application

A typical database application consists of data structures, a user interface, query options, and reporting capabilities. To design the structure of your application, carefully consider the function each component provides and its relationship to other components.

An assembled Visual FoxPro application typically presents a user with a menu and one or more forms for entering or displaying data. You provide functionality and maintain data integrity and security by attaching code to certain events. Queries and reports allow your users to extract information from the database.

Structure of a typical Visual FoxPro application

When structuring your application, you need to consider the following tasks:

  • Setting the application's starting point.
  • Initializing the environment.
  • Displaying the interface.
  • Controlling the event loop.
  • Restoring the original environment when the application quits.

The following sections provide details about each of these tasks. Typically you would create an application object to complete these tasks; see the Tasmanian Traders sample application located in the Visual FoxPro \Samples\Tastrade directory for an example of this technique. Also, if you use the Application Wizard to compile your application, it creates an application object. Or, if you want, you can use a program as the main file that handles these tasks. For more information, see Structuring a Program as a Main File".

See Also

Compiling an Application | Setting the Starting Point | Application Framework Files | Application Builder | Initializing the Environment