> Migration for Web environment - Generation and Engine Access
< A simple application of demonstration
Migration of Applications for Web Environment - A Practical Approach
As shown in figure 13 notes is a module of single interface, the srv_interface.sh, and how he deals with the information the application. As this stage of development there is only the interface to character, this script only makes call to the module srv_insterface_txt.sh, [line 3], but now defines a point where other models can be incorporated to interface to follow the same protocol.
Figure 13 - Module srv_interface.sh
The module srv_interface_txt.sh, specific to treatment for interface in character mode, because it is a more extensive code, will be presented in just a few pieces shown in Figures 14 and 18.
In Figure 14 shows the "interface", [line 246], called by the Register of Clients, through the common module "svr_interface.sh", and below, according to the standard informed, appear the routines of the clear, "inicia", [line 249], the menu of options, "seletor", [line 250] and the maintenance, default "cadastro".
Figure 14 - Module srv_interface_txt.sh - default
As shown in Figure 15, in the default "cadastro", [line 216], there is initially the routines of displaying titles, exibe_titulo; names of fields, exibe_nome, display values, exibe_valor; [line 218], these contents informed by app_register_client.sh, as previously seen in Figure 11. Following appears the loop, [line 220], which receives the values of the fields, containing the procedure called "recebe_valor," [line 221], and then tracking the keys of editing, [lines 222 and 223].
Figure 15 - Module srv_interface_txt.sh - maintenance
For cases to display will be presented the "exibe_nome" that represents well the criteria used by other routines of view, presented in figure 16. As can be noted, it is a loop, [line 136], which covers the table naming informed by the application and for each occurrence with content displays the text in particular line-column of the screen, "echo", [line 142 ].
Figure 16 - srv_interface_txt.sh Module - displays
Continuing, are explored some excerpts of the session of editing "recebe_valor" as the figure 17, where initially note the verification of occurrence error message, "$erro", [line 132], and using them "echo", [ line 134] to display.
Figure 17 - Module srv_interface_txt.sh - error
Finally, in Figure 18, it presents an piece of the loop that receives the information that composes the editable fields. It is the concatenation character editable in a variable, [line 245], the update of the field, "copia_valor," [line 246] in their view, "echo", [line 248].
Figure 18 - Module srv_interface_txt.sh - character
Below, Figure 19 illustrates the implementation of this model a character in a terminal:
Figure 19 - Module srv_interface_txt.sh - execution
In this moment is observed the interface "srv_interface_txt.sh" running the issue based on information previously provided by the application. This is noted the titles, names and content of field informed. Moreover, the prompt for the "Client phone" and a small ratio of keys of action. Although simple, already noticed here which was established a pattern of development, with well-defined rules, which if are accepted and meet the needs of the business, can be used for other applications. Of course no business in the real world accepts as primary requirements, but the principle is basically the same, varying only the degree of complexity of its specifications.
> Migration for Web environment - Generation and Engine Access
< A simple application of demonstration
Migration of Applications for Web Environment - A Practical Approach