- Creating an internal component
- Steps to follow
- Internal component and analysis: total autonomy
- Sharing internal components (via SCM)
10. Internal components in practice
An internal component is a set of elements from a project. This set is used to:
- Organize a project: you can create internal components to group the elements of a project, by functionality, for example.
- Share elements between multiple projects: The elements in an internal component can be shared between multiple projects via the SCM. For more details, see Sharing internal components (via SCM).
Compared to standards components, internal components have the advantage that they can be debugged directly from the project in which they are used.
Difference with a standard component: An internal component allows you to include all its elements in the interface of the project. All the "public" elements of the internal component can be handled directly in the editor.
When you use a standard component, the "public" elements cannot be handled directly. To modify the standard component, you need to open the corresponding project.
Creating an internal component
Steps to follow
To create an internal component:
- On the "Project" tab, in the "Project configuration" group, expand "New configuration" and select "Internal component". The internal component creation wizard starts.
- Specify the characteristics of the internal component:
- its name. The name of the internal component will be used for the WCI file that corresponds to the description of the internal component. This name will also be used to create a subdirectory in your project with all the elements of the internal component.
- its caption.
- its description.
- Select the elements that will be included in the internal component. An internal component can contain all types of elements from a project: pages, reports, templates, etc.
- Specify the elements of the internal component that will be directly accessible in the code and in the preset actions of the project hosting the internal component.
Remark: The automatic completion will display accessible (or "public") elements. They can be used by the elements of the project or from another internal component. Inaccessible (or "private") elements can only be used by another element of the internal component (the automatic completion will display "private" elements only from the elements of an internal component).
- Specify how the data and execution contexts are managed. There are three modes to manage data and execution contexts:
- Use the project analysis or no analysis (full share): The internal component accesses the data files of the project. The internal component and the project use the same execution contexts.
This is the default mode if the internal component does not use an analysis.
- Use the project analysis with different execution contexts (advanced mode): The internal component accesses the data files of the project. The internal component and the project use different execution contexts.
This mode is reserved to specific cases.
- Use a specific analysis: The internal component accesses its own data files. The internal component and the project use different execution contexts.
This is the default mode if the component uses an analysis.
In this case, the analysis used by the internal component must be specified. You can also create a new analysis directly. This analysis will be associated with the internal component.
- Validate the new internal component. At any moment, you can:
Tip: An internal component contains no code for declaring the global variables. A set of procedures can be used to initialize the internal component.
- Change the characteristics of the internal component via its description window.
- Handle the internal component and its elements.
Internal component and analysis: total autonomy
An internal component can be linked to its own analysis. In this case, the project that hosts the internal component can have multiple analyses:
- the analysis of the project.
- the analysis of the internal component(s). This analysis is defined when creating the internal component. It can also be selected from the internal component description window.
The elements generated by the RAD for the internal component will be saved in the internal component directory. If changes are made to the analysis of the internal component, the RAD will prompt you to generate the elements these changes applied to.
Sharing internal components (via SCM)
The internal components can be shared between multiple projects via the SCM.
To share an internal component via the SCM, the project containing the internal component must be in the SCM. You can:
- create the internal component from a project located in the SCM. The internal component will be automatically saved in the SCM.
- import a project containing one or more internal components into the SCM. The internal components will be automatically included in the SCM.