Skip to content

Component Files

Component files are used to divide a project into functional units. Different component categories represent specific types of functionality.

For example, an Order Entry Windows application would contain components for performing the following operations:

  • Customer Data Entry
  • Stock Available Report
  • Order Entry
  • Printing Orders
  • Customer Listing, etc.

Component Types

The DataFlex Studio provides special support for the following component categories:

For Windows Applications

View Components

View components are data entry forms that bind data entry controls to a data dictionary structure. View components are used to perform some particular type of database task such as customer maintenance.

New views are created by selecting the View / Report tab page in the Create New Dialog.

Report Components

Report components query data from a data dictionary structure. Report components are used to produce a formatted query such as a customer listing or a sales performance listing.

New reports are created by selecting the View / Report tab page in the Create New Dialog.

Database Dialogs

Database dialogs are modal forms that bind data entry controls to a data dictionary structure. Database dialogs can be used for the same purpose as view components; however, they are normally used to build lookup lists of data.

For example, a lookup that displays rows of data from a customer table can be used to browse and select a single row for editing in a view component.

View components and database dialog components are usually used together to produce view components that allow users to select rows to be edited from lookups (database dialogs).

Dialog Components

Dialog components are modal forms that do not bind to the project's data dictionaries. Dialog components are used to present information to the user (such as an "About" dialog).

Business Process Components

Business process components bind a data dictionary structure to some batch operation on one or more rows of data.

For example, an end of month process that archives sales data.

Data Dictionary Components

Data dictionary components are subclass declarations of the DataDictionary system class. Each subclass will define the business rules for a given table in the project's database.

Data dictionary classes are used by other components to construct data dictionary object structures (DDOs). These are used to bind data to the particular component and ensure that the data is presented and operated on according to each data dictionary's business rules.

Data dictionaries are defined using the Database Builder tool.

See Also: DDO Explorer

For Web Applications

Web Service Objects

Web service objects define an interface of methods that are published as web services. A web service object's interface may or may not be bound to a data dictionary structure.

See Also: Publishing Web Services, Developing Web Applications

Web Views

Web views are data entry forms that allow you to bind data entry controls to a data dictionary structure. Views are used to perform some particular type of database task such as customer maintenance.

New web views are created by selecting the Web Object tab in the Create New Dialog.

Web Dialogs

Web dialogs are modal forms that allow you to bind data entry controls to a data dictionary structure. Web dialogs can be used for the same purpose as a web view. They are also used to build lookup lists of data.

For example, a lookup that displays rows of data from a customer table can be used to browse and select a single row for editing in a view.

Data Dictionary Components

See above.

Classifying Components

The Studio analyzes each file used in a project to determine if it belongs to one of the above component types.

A file will be classified as a component file if it contains an outer level object whose superclass is classified under one of the component types. That is, the object classified as a component object is not nested inside any other object in that file.

If a file contains two outer level objects that have different classifications, then the first classified object determines the file's component type.

Classes are associated with a component type using the ComponentType meta-data tag. A class's component type association is inherited by subclasses.

For more information, see Studio Meta-Data.

Components in Workspace Explorer

Workspace Explorer displays the composition of component files used by the current project. Workspace Explorer's interface supports opening, adding, and removing the listed component files.

Adding and removing component files is a special operation supported for View and Report components in Windows applications or WSO and WBO components in Web Applications.

Testing Components

Since component files are functional units, it would be convenient to be able to test a component in isolation, i.e., separate from the rest of the project. For Windows applications, the Studio supports this via the concept of "Test Projects".

A test project is a cut-down Windows application project intended to be used for testing one or more component files in isolation from the project they belong to.

Create a test project by selecting "Test Windows Project" from the Create New dialog.

To use the test project, make it the current project in Workspace Explorer, then add the component you want to test to the test project (you can use the Add Component context menu option in the Code Editor or Visual Designer). Now click the run button to run the test project and begin testing and debugging your component.

Tips for Using Test Projects

  • Once you create a test project, you can modify it as required. This may be necessary, for example, to simulate certain operations in your main project such as user login, etc.
  • You can add special debugging code to test projects.
  • You may create as many test projects as you want in each workspace. If you have a component that is tested frequently, you can take advantage of this to build a dedicated test project for that component.
  • Test projects may contain as many components as you like. If you are reusing a test project for several components, then you may want to remove old components from the project.

See Also