Discover how object notation can simplify your developer’s life!

With the object notation, available as a preview in 4D v16 R4, your code is simpler to write, easier to read and more natural to think. That is true. But did you really see the full potential of the object notation?

Before 4D v16 R4, when you wanted to create a detail form to enter contact information from an object field, you had no choice but to write an expression like OB GET ([CONTACT]Info; “City”) in the variable data source. You could retrieve the attribute value, but it was not possible to change it. Moreover, you had to write a loadRecord method with the OB GET command for each attribute and a saveRecord method with the OB SET command for each attribute.

What does object notation change in this scenario? From 4D v16 R4, you just write [CONTACT]Info.City in the variable data source! This variable is available in Read/Write mode. OB GET and OB SET commands are no longer necessary. That’s it! Now you see the full potential.

In addition, OB GET ARRAY and OB SET ARRAY command are also no more needed with the object notation. Download this database for more examples.

Example database

Where can I use the object notation?

Of course, Method Editor is the first place where it can be used. To find all details about this new syntax, take a look at this post. But there is more than that, object notation is bringing additional benefits as explained below.

 In Form Data Source

You can now use object notation in form object data source! Thus, it becomes easier to create a detail form.

Example of Data source in design mode

As you see in the example, you can now directly access a field object attribute: [Person]OB_Field.Firstname.

There are several advantages of using object notation and no longer an expression (i.e. using OB Get command):

  • The attributes are now in Read/Write mode. When the user enters a value in the form, the attribute value is updated.
  • You can use standard actions to navigate in the record selection: Next Record, Save Record, etc…

  In Debugger

You can also use the object notation in the debugger. In the custom watch pane, you can add an attribute of an object field or variable, to directly see its current value. Please take a look at this video to see what the new possibilities are.

Vanessa Talbot

• Product Owner •

Vanessa Talbot joined 4D Program team in June, 2014. As a Product Owner, she is in charge of writing the user stories then translating it to functional specifications. Her role is also to make sure that the feature implementation delivered is meeting the customer need.

Since her arrival, she has worked to define key features in 4D. She has worked on most of preemptive multi-threading new features and also on a very complex subject: the new architecture for engined application. Vanessa has a degree from Telecom Saint-Etienne. She began her career at the Criminal Research Institute as a developer for the audiovisual department. She has also worked in media and medical fields as expert in technical support, production as well as documenting new features.