Product blank

Need a magic wand? Here are computed class properties!

The apparition of classes in the 4D development environment has made programming more modern and easier to scale. Classes allow the definition of properties, functions and also support inheritance.
In your application, you probably have a class to manage scientific or financial data. Let’s take the example of financial data. Say you have created functions to calculate taxes. If you also manage several countries, you may have used inheritance to manage the different rules. Then, you display these results in a list box, but if the user changes one of the attributes used in the formula, you have to manage this event to update the result.
With 4D v19 R3, 4D allows you to simplify this process thanks to computed properties: You can define a get and set function for your computed property, and when you add your property to a list box, everything is handled automatically by 4D. No more business logic in your UI.

Product blank

A magic show awaits you with ORDA’s computed attributes!

It is often helpful or even essential that databases be adapted in a flexible and evolving way to users and their businesses in the computer world. The control of accessible data is also a recurrent and sensitive subject. From this point of view, developers use methods and formulas that are sometimes complex to give or restrict access to information, depending on the context or the access rights of the users.

Let’s take a simple example. In your application, you sometimes need to display a list of people. One of the columns displays their full names, but in your database, you have a first name field and a last name field. Currently, you write a formula in the list box column, and you have to manage the sorting on the column yourself. Wouldn’t it be great to have a computed field where you can define its calculation formula and sorting method, and have all the business logic inside the class and not in each interface?

Well, starting with 4D v19 R3, 4D provides a solution to this, with computed attributes.