COMPANY
COMMUNITY
BLOG
HELP
MY ACCOUNT
EN PT ES

Imagen6239E

Sub-types in the GeneXus Olimar version

The changes that come in GeneXus Olimar version concerning the use of sub-types, benefit the referential integrity, improve performance and programming, as well as its overall use. By Pablo Mazzilli, from ARTech's support team.

Relations among GeneXus attributes are established through their names. This explains the importance of assigning the same name to attributes that correspond to the same concept, and of distinguishing attributes that are conceptually different from each other by using different names.
Sometimes, however, it is necessary to assign different names to attributes that are conceptually the same. In that case, GeneXus provides Sub-types that make it possible for two attributes with a different name to refer to a single concept.

Typical cases that call for the use of Sub-types:
1-     When including several instances of the same attribute in a transaction (Multiple instances)
2-     Specialization (Clients and Suppliers as Company sub-types)
3-     When avoiding referential integrity checks
   
The GeneXus Olimar version has new characteristics and several upgrades in terms of sub-type handling, the most important of which are as follows:
                             
1-     Nested sub-types (sub-type sub-types) may be defined by obtaining inferred values.
In the following example, the name of the client can be obtained from the "Customers Who Have Made a Purchase" Transaction (CusPurNam)
                
People Transaction
PepCod*
PepNam

Customer Transaction
CusCod*            sub-type of Customer.PepCod
CusNam             sub-type of Customer.PepNam
CusAdd

Customer Who Have Made a Purchase Transaction
CusPurCod*            sub-type of CusPur.CusCod
CusPurNam            sub-type of CusPus.CusNam
CusPurId


2-     Sub-types and super-types may be defined in the same extended table (for instance, in the same Transaction).
      

Example:
In the following Transaction, the names of the employees and their managers, who also happen to be company employees, are entered.

Employee Transaction
EmpCod*        
EmpNam         
EmpManCod             sub-type of Manager.EmpCod
EmpManNam            sub-type of Manager.EmpNam

 
EmpManNam is inferred from the same table. Moreover, the referential integrity check of the table is carried out with the table itself in EmpManCod.

                                         
3-     Updating sub-types that are inferred from the rules of a Transaction or a Procedure is now possible.
E.g.: use of the add and substract rule in Transactions.
                
4-     Establishing an order per inferred sub-type in a For Each is now permitted.

      
5-     Vertical formulas based on attributes that are also sub-types may be defined.

              
6-    Checks upon specification time when defining groups of sub-types have been added. These checks issue alerts if the groups have not been correctly defined, thus making it easy to spot, in a timely manner, the invalid sub-type/super-type combinations that may have been generated.  Checks have also been added for the use of sub-types in the objects in order to warn against ambiguous references or sub-types that cannot be instanced.


Moreover, the use of sub-types in the Olimar version has reaped the benefits of the improvements made on the reorganization of GeneXus. After this version, the reorganization will no longer be carried out in two steps, since a super-type will be replaced by a sub-type. Also, possible referential integrity errors will be avoided during reorganization (for instance, upon creating super-types from sub-types).

More information at GXDL:
http://www.artech.com.uy/betas/gxdl/iehelp.htm?English/Genexus_Olimar_Beta_3/DevEnv/Docum/ReleaseNotes/Olimar/Subtipos.htm

Related
GeneXus Olimar version beta 3 has been released
From GeneXus Olimar version: Theme Object (I)
First system developed with the Pocket PC generator
GeneXus Inc. has launched a new on-line support system
Database reorganization in GeneXus
From the GeneXus Olimar version: Client Side Validation
GeneXus releases its next version