Table of contents

Introduction

Development Environment

Web Development and Improvements in user experience

(Productivity and Enterprise-level Application Development Features)

Ajax Overview, [[21759|GeneXus' target='_blank'>Ajax' target='_blank'>Ajax Overview, [[21759|GeneXus and Ajax]]

Business Components

Business Component - Publication as an Enterprise Java Bean

Practical course: Bluesky Charters
 

Application Localization

Application Localization
Demo
Translation Tool
Help "in any language"
Practical course: Bluesky Charters
 

Patterns

About this topic
Patterns based development
Description
Built in Patterns
Work With Pattern
Demo: Work With Pattern
Practical course: Patterns
 

Better data model

Null handling optimizes navigations
Nulls property

 

User experience

New options on rightclick in win
 

Reverse Engineering

Database Reverse Engineering Tool
 

New Platforms

MySQL
.Net Mobile Generator
More J2EE support than ever
 

Data Types and Methods

Message Queue handling data types

DirectoryDataType
LDAP Data Type

URL access Property
New IIF function
New byte count function
New Methods for attributes, variables and enumerated domains!
XSLTApply Method
Procedures can now call web objects
Web Services: Grouping Locations
News about model, object, and control properties


Official Content

There are two ways to update a database in a Procedure object

1. Directly with commands.
2. Using Business Components.

Samples

Consider the following Transaction object:

Customer
{
  CustomerId*
  CustomerName
}

Below are two possible alternatives to solve an insertion (similarly, there are two alternatives to update and delete).

1. A direct insertion using the New command (this code can only be included in a Procedure Source):

       Procedure Rules:
       Parm(&CustomerId,&CustomerName);

       Procedure Source:
       New 
          CustomerId = &CustomerId
          CustomerName = &CustomerName
       Endnew


2. An insertion using the business components concept (this code can be included in a Procedure Source and/or in other GeneXus objects in their events section):

       Procedure Rules:
       Parm(&CustomerId,&CustomerName);

       Procedure Source:
       &Customer.CustomerId = &CustomerId      
       &Customer.CustomerName = &CustomerName
       &Customer.Save()  //&Customer is a variable based on the Transaction Customer defined as a Business Component
       Commit  

Note: Since GeneXus 15 you can use the Business Component Insert method.

The question is, which of these two methods is better?

The answer, as often happens, is that it depends! From the point of view of performance, the first method is preferred, since there are no controls involved and the generated SQL sentence will be optimized for bulk updates. On the other hand, from the point of view of consistency, the second method is best, since all the controls will be enforced independently if data comes from a screen or a Procedure.

So, a good rule of thumb would be to always use Business Components unless performance is critical.

See Also

Business Components - Differences between the Save method and the Insert and Update methods
Error handling in Business Components

Last update: November 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant