A property is a definition of an attribute (an instance variable) -with accessor methods. A property definition might carry -value-constraints and a default value.
A property is a definition of a configurable instance variable.
Index: doc/next-tutorial/next-tutorial.html =================================================================== diff -u -rd00b7a9fa608e137faea6e52ded881b871d5c29e -r6be525008610d18d96705955bc46851f6dae29fe --- doc/next-tutorial/next-tutorial.html (.../next-tutorial.html) (revision d00b7a9fa608e137faea6e52ded881b871d5c29e) +++ doc/next-tutorial/next-tutorial.html (.../next-tutorial.html) (revision 6be525008610d18d96705955bc46851f6dae29fe) @@ -733,7 +733,7 @@
set
and unset
. Depending on the variable name (or more
precisely, depending on the variable name’s prefix consisting of
-colons :
) a variable is either local to a method, or it is an
+colons ":
") a variable is either local to a method, or it is an
instance variable, or a global variable. The rules are:Listing 16 shows a method foo
of some class Foo
referring to differently scoped variables.
Generally, there is no need to define or declare instance variables in -NX. In some cases, however, a definition of instance variables is -useful. NX allows us to define instances variables as properties on -classes, which are inherited to subclasses. Furthermore, the -definition of properties can be used the check permissible values for -instance variables or to initialize instance variables from default -values during object initialization.
As described above, there is no need to declare instance variables in
+NX. In many cases, a developer might want to define some value
+constraints for variables, or to provide defaults, or to make
+variables configurable upon object creation. Often, variables are
+"inherited", meaning that the variables declared in a general class
+are also available in a more specialized class. For these purposes NX
+provides variable handlers responsible for the management of
+instance variables. We distinguish in NX between configurable
+variables (called property
) and variables that are not configurable
+(called variable
).
A property is a definition of an attribute (an instance variable) -with accessor methods. A property definition might carry -value-constraints and a default value.
A property is a definition of a configurable instance variable.
The term configurable means that (a) one can provide at creation time of
+an instance a value for this variable, and (b), one can query the
+value via the accessor function cget
and (c), one can change the
+value of the variable via configure
at runtime. Since the general
+accessor function cget
and configure
are available, an application
+developer does not have to program own accessor methods. When value
+checkers are provided, each time, the value of the variable is to be
+changed, the constrained are checked as well.
The class diagram above defines the classes Person
and
-Student
. For both classes, accessor methods are specified with the
-same names as the attributes. (Note that we show the accessor methods
-only in this example, we omit it in later ones). By defining
-properties we can use the name of the attribute as method name to
-access the attributes. The listing below shows an implementation of this
-conceptual model in NX.
Student
. For both classes, configurable instance variable are
+specified by defining these as properties. The listing below shows
+an implementation of this conceptual model in NX.