COMPANY
COMMUNITY
BLOG
HELP
MY ACCOUNT
EN PT ES

Imagen6417E

From GeneXus 8.0: New Java Generator Features

This version of the generator mainly stands out for making it easier to convert Windows-interface applications into Java, and to optimize three-tier applications.

In order to obtain greater ease in the conversion of traditional Client/Server Windows applications into Java, such as Visual Basic or Visual FoxPro, several features were implemented. We would like to highlight the one that introduces an alternative to the whole screen dialog, pretty similar to field-to-field validation. (For more details, refer to the Validation at Client Level document).

In this generator, the DBConnection data-type was also implemented, which enables handling connections in a dynamic way for two-tier Windows applications.

Example:

Sea &MyConn DBConnection type
Event 'Conectar'
&myConn = GetDataStore("Default")
&myConn.UserName = trim(&Usuario)
&myConn.UserPassword = trim(&Password)
&myConn.JDBCDriverName='com.inet.tds.TdsDriver'
&myConn.JDBCDriverURL='jdbc:inetdae:barbanegra:1433?database=testemp2'
&myConn.ShowPrompt = 2
&Res = &myConn.Connect()
Do case
Case &Res = 0
&ConnOk = 'S'
return
Otherwise
&ConnOk = 'N'
msg('No se pudo conectar, reintente...')
Endcase
EndEvent // 'Conectar'

There are other new features in the generator that facilitate conversion such as the submit command, the calendar and the calculator, as well as some properties from the win-interface group model:

- Maximum workfile lines
- Autocenter objects in (0,0)
- Field Exit = Enter, Tab, Shift-tab
- Field Exit = Passing last char
- Prompt Key = FX (for example F8)
- Menubar = Caller's.

As far as facilities introduced for three-tier applications, we would like to highlight the possibility of running the load event of a work panel in the server, by only changing one of its properties.

By working in a distributed application, the rule of thumb in order to obtain good performance is trying to run the largest amount of code in the server; basically, this means transferring all the code into the server, except for the portion that corresponds to the interface.

For batch objects such as procedures and reports (without interface) there is no problem, because they are defined as remote by only specifying a property. As far as objects handling the interface, for transactions and reports with printblocks sent to the screen, facilities have been introduced for their optimization.

However, the load event, which contains code that should be obviously run in the server and not necessarily in the client, was pending for work panels. For optimization, it was necessary to re-program it, for instance, transferring the whole code into a procedure and having it be defined as remote.

After this version, by configuring a new work panel property -Execute Load Events in the Application Server- you may also determine execution of the whole load-event logic in the server automatically, as well as database access.

These are the main features that have been implemented in the Java generator, version 8.0.