Data Module Wizard

Data modules simplify data access development in your applications. Data modules offer you a centralized design-time container for all your data access components. This enables you to modularize your code and separate the database access logic and business rules in your applications from the visual containers like panels and frames.

The Data Module Wizard creates a data module, or specialized container for data access components. Once you define your DataSet components and their corresponding Column components in a data module, all frames that use the module have consistent access to the data sets and columns without requiring you to recreate them on every frame each time you need them. Data modules do not need to reside in the same directory or package as your project. They can be stored in a location for shared use among developers and applications. For more information on data modules, including a tutorial, see Separating database access logic and business rules from the user interface.

To open the Data Module Wizard, choose File|New to open the Object Gallery. Double-click the Data Module icon.

If a project is currently open, the Data Module Wizard displays. If no project is currently open, the Project Wizard steps you through creating a new project. Then, the Data Module Wizard is displayed.

The Data Module Wizard displays default values for the data module's package, class name, and file name.

Package

This field displays the package name derived from the project file. To assign a different package name to the data module file, click in the Package field and type in a new name.

For more information on packages, see the Packages topic in the "Creating and managing projects" chapter of Getting Started with JBuilder.

Class Name

This field displays the default name assigned to the data module class. To rename it, click in the Class Name field and type in a new name.

File Name

The full path and .java file name for the data module class is displayed here. This file path and name is constructed from the source path node under which the project exists (as defined in File|Project Properties), plus the contents of the Package and Class fields. This field is not editable. If the path or name are not correct, edit the Package and Class name fields on this page of the wizard. The file is created with the actual location and name indicated here.

When you select OK, the wizard creates your custom data module. You can add Data Access components to the data module in the UI Designer. Adding Data Access components through the UI Designer also generates getter methods for these components.

You need to add the data module to the Frame class definition in your project (for example, DataModule1 dm1 = new DataModule();) and compile the application to make the data module available to JBuilder.

For more information on data modules and a tutorial for creating a data module using sample InterBase files, see Separating database access logic and business rules from the user interface in the Database Application Developer's Guide.