Current Page: NeXtMidas Training Getting Started - Part 2 Advanced Results Parameters Objects
- - - | Objects NeXtMidas allows results to be any type of Java Object, not just a number, String or Table. NeXtMidas allows objects to be accessed using the same dot syntax used to access a table. Finding methods in objects can vary based on the type of class and how it is implemented. The exact details of this can be found in the KeyObject section of the NeXtMidas User's Guide. When trying to access the method `getMyValue` from the class `MyStuff`, it is encouraged to spell out the entire method name! Leaving off only the get and set portion of the method name is common and also considered good practice:
          MyStuff.MyValue
      Generally, from the macro language, objects may also be reference by a digraph formed by the upper case letters in the name. For instance, you can write
          MyStuff.MV
to access the same getMyValue method discussed earlier. Most objects are accessed via their get/set/is methods. An object with a value `FOO` will make that value visible by providing `getFoo()` or an `isFoo()` method. An object with a value `FOO` that can be modified can make it modifiable by providing a `setFoo(..)` method. When an object has a `getFoo()` method but no `setFoo(..)` method the value `FOO` is said to be "read only." Constants are accessible via the dot syntax as well. Previously, public variables were accessible via the dot syntax. However, this behavior has been deprecated as it is bad practice to declare public variables and it causes problems for backward-compatibility.
Java Experts Take Note:
The use of the `getFoo()`, `isFoo()`, and `setFoo(..)` methods follows the definition of a Java Bean. This provides for immediate compatibility with all objects that follow the Java Bean specification.