Páginas

sexta-feira, 21 de agosto de 2020

DICAS 3042- WINDEV TUTORIAL 65 - COMPONENTES EXTERNOS - CRIANDO - PARTE A



https://youtu.be/FYJgUS8MMBA



Bom Dia/Boa Tarde/Boa Noite

Esse Ao Vivo vai estrear as 09:00 do dia 01/09/2020 

DICAS 3042- WINDEV TUTORIAL 65 - COMPONENTES EXTERNOS - CRIANDO - PARTE A
Tutoriel WINDEV : Leçon 4.11.a. Réutilisez du code grâce aux composants externes Création


ASSUNTOS

EXPLICANDO O QUE E´COMPONENTE EXTERNO
ENTRANDO NO PROJETO E MOSTRANDO O QUE SERA FEITO
CRIANDO O COMPONENTE 
GERANDO O COMPONENTE
CRIANDO HELP DO COMPONENTE 


Video original da Franca

https://youtu.be/cMmKAiDWceA


Playlist Windev TUTORIAL

https://youtu.be/3DshsXJ8I2M













Lesson 4.11. Re-use code via the external components
This lesson will teach you the following concepts
  • What is an external component?
  • Creating an external component, step by step.
  • Distributing an external component.
Lesson duration

Estimated time: 40 mn
Previous LessonTable of contentsNext Lesson
Overview
An external component is a building block that can be re-used in an unlimited number of projects (and therefore executables).
Principle of an external component
An external component allows you to have an identical process with a single source code to perform a given operation even if this process must be performed by several projects.
The projects that use an external component have access in the WINDEV editor to the name of objects, procedures or methods made visible by the component creator. The projects cannot see or modify the source code. This ensures confidentiality and stability of source code.
Creating an external component is child's play.
How to proceed? Don't change anything, create your windows, procedures, classes. Then, when you're done, create a Component configuration with all the elements needed for your component, and generate. It's that simple!
A component can contain code, windows, an analysis, data files, etc!

Remark

Five methods can be used to share "code" in WINDEV:
  1. The sets of procedures.
  2. The classes.
  3. The supercontrols (via a dictionary).
  4. The external components.
  5. The 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 modifications "made by mistake"!

The huge projects

The external components allow you to have several small projects as well as a central project in which the elements found in the other projects are visible. The external components are a lot more convenient to use than the libraries (WDL files).

The databases accessed by several 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.

The processes used in several projects

Complex processes are often used in several projects. These processes can be re-used via "sets of procedures" or "classes". In this case, the modifications may not be applied to the different projects, making these elements no longer compatible between themselves. Using external components prevents such out-of-sync modifications, preserves the compatibility between projects and simplifies the common modifications.
Furthermore, the PRIVATE keyword allows you to ensure the confidentiality of your code at all levels of external component. When re-using your external component in another WINDEV project, the call to a PRIVATE procedure will not be allowed but the documentation regarding the use of procedure will be displayed!

The ability to distribute a feature or set of features

The external components allow you to develop a feature or a set of features. Other WINDEV developers will be able to include these features in their own 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.
Your external components can be distributed (free of charge or not)!

Multi-product external component

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 the elements coming from different products (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).
Step by step

Step 1 : Creating an external component

We are going to create an external component from the "WD Full Application" project. This project is used to manage orders, products and customers. This external component will be used to immediately find out in another application the customers corresponding to a given city.
During the call to the external component, you will have the ability to:
  • Pass a city in parameter.
  • Retrieve a string containing the customer name and the total amount of his orders.
To avoid having to develop the code required for the component to operate, the "WD Full Application" project contains all necessary elements.

Answer

If you did not create the windows in the previous lessons, you can follow this lesson by opening a corrected project: in WINDEV's home page (Ctrl + <), click "Tutorial" and select "Full application (with windows)".
A full corrected application project is also available: in WINDEV's home page (Ctrl + <), click "Tutorial" and select "Full application (Answer)".
  • For the component needs, the project contains:
    • a "QRY_OrdersByCity" query. This query is a query with parameters used to find out the customers corresponding to a given city as well the total amount of their orders.
    • a set of procedures "SET_Component". This set of procedures contains:
      • the "GiveOrdersByCity" procedure that returns, for the city passed in parameter, a string containing the customer name and the total amount of his orders.
      • the "DataLocation" procedure that is used to locate the data required by the component.
    • an analysis used to described the data files for storing information.
  • We are now going to create our component. To do so, a project configuration must be created.

    Remark

    The project configurations are used to create several "targets" from the same project:
    • A 32-bit application,
    • A 64-bit application,
    • A component,
    • ...
    You can choose the desired configuration and generate all the elements for all project configurations in a single operation, at any time.
  • To create a project configuration whose type is "Component":
    1. On the "Project" pane, in the "Project configuration" group, expand "New configuration" and select "External component (WDK)".
    2. The project configuration creation wizard starts. WINDEV proposes to create a project configuration whose type is "Component". Go to the next step.
    3. Give a name to your project configuration: "CompoOrdersByCity" for example. Go to the next step.
    4. Keep the default options. Go to the next step.
    5. Select the elements that will be included in the project configuration. In this example, these elements will also be found in the component.
      • Click the "None" button.
      • Select the "QRY_OrdersByCity" and "SET_Component" elements.
        Project configuration
    6. Go to the next step and validate the configuration creation.
    7. The new configuration automatically becomes the current configuration.

      Remark

      To find out and modify the current configuration, use the "Project explorer" pane.
      'Project explorer' pane
      The configuration in bold corresponds to the current configuration. To change the current configuration, double-click the name of the configuration to enable.
  • We are now going to generate our component.
    1. On the "Project" pane, in the "Generation" group, click "Generate".
    2. The component generation wizard starts. Go to the next step of the wizard. WINDEV lists the elements that will be included in the component (elements specified in the configuration and analysis).
      Generation of a component - Elements to integrate
    3. Select all elements ("All" button) and go to the next step.
    4. The wizard asks you to select the component elements that will be accessible from the client application. In our example, only the set of procedures "SET_Component" will be used:
      Generation of a component - Accessible elements
    5. Go to the next step.
    6. WINDEV proposes to allow the translation of component. This feature is interesting if your component must be used by multilingual applications.
      Generation of a component - Translation of the component
      If the option "Allow component translation" is checked, the specified elements of the component can be translated from the application that uses component.
      This translation will be performed via WDMSG, independent module used to check out and check in the project messages to translate.
      In this example, don't check this option. Go to the next step.
    7. Choose the component languages. Our example will contain the English language only. Go to the next step.
    8. The wizard proposes to manage the different component versions. In our example, the component was just created.
      Keep the default options. Go to the next step.
    9. Type the information regarding the component:
      • Owner,
      • Caption, Copyright, ...
    10. Go to the next step.
    11. You have the ability to associate an image with your component. Go to the next step.
    12. Specify the main component overview. This overview will allow the user to find out the component purpose. Type for example:
      Generation of the component - General presentation
    13. Go to the next step. The wizard will automatically generate the documentation about the component. This documentation can be based on the comments inserted into your source code.
    14. Go to the next step. You have the ability to modify the generated documentation. Don't do anything. Go to the next step.
    15. You have the ability to create a help file associated with your component (CHM format). This help file will be supplied along with the component. The users will be able to access it by pressing F1 from the component code.
      We will generate no help file. Go to the next step.
    16. The component will not be saved in the SCM. Go to the next step.
    17. All we have to do now is give a physical name to our component.
      Component generation
  • Validate ("Finish"). A message indicates that the component was generated. Click "End" to validate the message.
  • Well done, you've just created your first ready-to-use component!

DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C