The Easy Invoicing example mentioned in
http://samples.genexus.com now uses Data Providers, Business Components and the new Initial Value functionality to load data. At first I kept on using news. Why? Because inertia makes people continue doing what they’ve always done. You get used to doing things in a certain way. It's relatively fast, and it works, so why change it?
The reason is obvious once you know how powerful Data Providers are.
In the following image you can see its advantages.
As you can see in the image,- the new solution is much easier to read because it is clear which second-level register corresponds to which first-level register.
- I don’t need to use auxiliary variables to obtain the autonumber result.
- I don’t need to serialize or autonumber.
- I need to perform a lower number of assignments because things are solved in the Business Component. InvoiceDate is an example: At an attribute level, I specified the InitialValue property in Today(). Another example is the “last of the serial.”
- I don’t reprogram business rules in the procedure, avoiding programming errors or inconsistencies and lowering maintenance costs.
More Notes: • The Initialvalue property, to be specified in a Domain or Attribute is like a defaults’ default in GeneXus X Evolution 1.
• In the example, &Invoice is of Invoice type, with Invoice being the transaction with the same name.
• &InvoiceCollection is a Collection of Invoices.
• As to the variables, I didn’t even need to define them… GeneXus does it by itself because I used the appropriate nomenclature.
The application can be tested online in runtime at
http://samples.genexus.com/easy The knowledge base is online on the public and free GeneXus Server which is available to the entire GeneXus Community (that is, you can view it via browser or download and try it locally with your GeneXus X Evolution 1).
What we recommend is that you download GeneXus X Evolution RC.
This is meant to reprogram our inertia so that instead of making us stand still it will push us to change.
Posted by Armin Bachmann in his blog
De GeneXus y de la vida.