English|Português|Español
UserPasswordLogin

HOME
SESSIONS
INFO
Imagen6333E

From GeneXus 8.0 RC: Structured Data Types (SDT)

A new GeneXus object called Structured Data Type (SDT) has been created. It is used for defining data structures, which makes programming easier and more powerful.

Description
What is an SDT?
It is a simple way of representing data, whose structure is made up of several elements, for example, a customer's data. 

SDTs may be used in different ways, because they simplify parameter passage (e.g. they enable sending the client's data in a single variable between objects), simplify XML automatic reading and writing (with higher-level functions), and are used for improving code readability, etc. 

1- SDT Creation

An SDT is created as any other GeneXus object, from the Object/New Object menu:


2- SDT Edition 

The edition has two sections. One of them stores the object's structure (Structure), and the other one stores the object's documentation (Documentation). 
The structure of an SDT may have simple or compound elements:

In the name field, we identify the element, for instance, the client's name. Using the Data type field, we define the element's data type. Possible values are:
- GeneXus basic types (numerical, date, etc.) 
- Domains 
- Other previously defined structures (another SDT)

The collection field is used for showing whether the element is a list of elements, in other words, a collection.

It is possible to define elements made up of several simple elements. This is the case of the Address. Here, the data type field is disabled. 

The SDT editor is similar to the already-known editors used in GeneXus objects. Among its properties, aside from element definition, there is one that allows you to import a transaction's structure to an SDT.

This means that it may create a new client structure

from a transaction: 

and the result will be an SDT with the following structure:

b - SDT documentation 
It is used for writing a descriptive text of the object. 


In the next GeneXus News issue, we will describe other uses of the SDT object, the definition of more complex structures (collections), as well as specification, distribution, and other SDT properties.

 


 

Related
Learning from GeneXus 8.0 RC: new BLOB data
GeneXus 8.0 Release Candidate Released
Learning about GeneXus 8.0 RC: Unique Indexes
From GeneXus 8.0 RC: Structured data types (II)
From GeneXus 8.0 RC: Structured Data Types (III)
Web Grid Selection
From GeneXus 8.0 RC: Option Distinct Clause
From GeneXus 8.0 RC: Transactions as Web Components
GeneXus releases its next version