ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Component / External component
  • Overview
  • External component use cases
  • Teamwork
  • Large projects
  • Databases accessed by multiple projects
  • Processes used in multiple projects
  • Distribution of a feature or set of features
  • Cross-platform external components
  • Characteristics of external components
  • What is an external component composed of?
  • What elements are included in an external component?
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
An external component is a set of WINDEV, WEBDEV or WINDEV Mobile elements: windows, pages, reports, analysis, etc. This set of elements performs a specific operation. For example, a component can correspond to one of the following features:
  • Sending faxes,
  • Sending emails,
  • ...
An external component can be redistributed to other WINDEV, WEBDEV or WINDEV Mobile developers (free of charge or not). These developers will be able to easily integrate the feature included in the component into their application (or site). The component will therefore be integrated into and distributed with the application (or site).
For multilingual applications, a distributed external component can be translated via WDMSG from the project that uses the component.
Remark: To optimize the organization of your projects, you can use internal components. Internal components can be used to group resources based on specific topics.
External component use cases
Five methods can be used to share "code" in WINDEV:
  1. Sets of procedures.
  2. Classes.
  3. External components.
  4. Internal components.
Let's present some cases in which the external components can be useful.

Teamwork

A developer creates and maintains an external component that is made available to other developers. No risk of accidental changes!

Large projects

External components allow you to have multiple small projects as well as a central project in which the elements of the other projects are visible. External components are a lot more convenient to use than libraries (WDL files).
Reminder: To optimize the organization of your projects, you can use internal components.

Databases accessed by multiple projects

When the same database is accessed by several projects, you often find inconsistencies in the database caused by modified or old source code. By grouping the operations used to access the database (at least in write mode) in an external component, a single source code must be checked and maintained; therefore, the risks of database inconsistency are reduced.
Furthermore, using a component avoids recompiling the application when the analysis is modified.

Processes used in multiple projects

Complex processes are often used in several projects. These processes can be re-used via "sets of procedures" or "classes". In this case, changes may not be applied to the different projects, which makes these elements no longer compatible with each other.
Using external components prevents such out-of-sync modifications, keeps compatibility between projects and simplifies common changes.
Furthermore, the PRIVATE keyword allows you to set the privacy of your code at all levels of the external component. When reusing the external component in another WINDEV project, you will not be able to call a PRIVATE procedure but the documentation on the use of the procedure will be displayed!

Distribution of a feature or set of features

External components allow you to develop a feature or a set of features. Other developers will be able to include these features in their own WINDEV projects. Developers who use an external component can see the elements of the component that have been made visible. However, the source code cannot be viewed or modified.
You can distribute free or paid external components!

Cross-platform external components

An external component can be intended to operate in:
  • a WINDEV application,
  • a WEBDEV application,
  • a WINDEV Mobile application,
  • the three types of applications.
In this last case, WINDEV allows you to:
  • include elements coming from WEBDEV and/or WINDEV Mobile in the same external component.
  • specify the corresponding WLanguage code for each runtime platform (for example, a window is displayed by Open in WINDEV and a page is displayed by PageDisplay in WEBDEV).
Characteristics of external components
When creating the external component, the author specifies:
  • which elements in the component are visible to the user. Visible elements will be accessible programmatically, or via the "Project explorer" pane.
  • how to use the component (use mode, the parameters used to access the component functionalities, etc.). A short documentation (to be completed) is automatically generated and associated with the component.
Caution: A component is not a supercontrol. Supercontrols can only contain controls whereas components can contain windows, pages, reports, etc. In most cases, the component expects parameters, processes them and returns a result to the application that uses it. Furthermore, unlike a supercontrol, a component has a specific setup.

What is an external component composed of?

An external component can be:
  • defined and generated from an existing WINDEV, WEBDEV or WINDEV Mobile project. A "Component" project configuration will allow you to select the elements of the existing project to be integrated into the component.
  • created from an "External component" project. By default, this project is composed of an "External component" platform which will contain the elements required to create and generate the component.
This external component can then be integrated into other WINDEV, WEBDEV or WINDEV Mobile projects.
All the elements of the component are totally independent of the project in which it is integrated. The external component can have its own analysis, windows, reports, data files, etc.
When generating the external component, simply specify if the project that uses the component will access these elements. The project will not be able to read or manipulate elements that are not accessible.
The external component consists of several files:
<Component name>.WDKComponent file. Contains all the elements of the external component.
This file is required to include the external component in a project.
This file must also be provided in the client version of the application that uses the external component.
<Component name>.WDIComponent description (when developing applications only).
This file is required to include the external component in a project.
This file must not be provided in the client version of the application that uses the external component.
<Component name>.WDZFile with the dependencies of the WDK file (only for WEBDEV and WINDEV Mobile components)
File containing the dependencies of the WDK file. This information is extracted in the project in which the component is integrated.
  • For a WEBDEV component, this file contains the generated WEBDEV pages, images, etc.
  • For a Mobile component (iOS or Android), this file contains the Android generation files, for example.
<Component name>.WDOOptional file
Text file containing the list of the additional elements provided with the external component (data files, .INI files, etc.). This file can be created manually or generated automatically from the items specified in the "Other" folder of the "Project explorer" pane. For more details, see WDO file.
What elements are included in an external component?
An external component contains:
  • the elements to be distributed (windows, reports, etc.). These elements can be accessible (or not) when importing the component into a WINDEV, WEBDEV or WINDEV Mobile project. These elements cannot be modified from the project that uses the component.
  • a short description of the component.
  • a help text to reuse the component. This help is generated from the code comments.
Remark: By default, if an external component uses an analysis and data files, the HFSQL functions will handle these elements in an independent HFSQL context. These parameters can be changed in the advanced options of the component. For more details, see Advanced options of an external component.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/01/2023

Send a report | Local help