You define instance constants in the component type, where you often assign a default value to them. Afterward, you can change the final value in each of the instances of the component type.
Instance constants can have two forms:
- Only accessible from within the defining type = TRUE. It means that descendants can’t use it in methods.
- Only accessible from within the defining type = FALSE. It means that descendants can use it in methods.
A project engineer needs two regulators with two different regulating intervals. By using instance constants the engineer can design a simple solution. In short, the engineer can create a regulator component type that has an instance constant that defines the regulating interval. When he uses instance constants in the type, he can add two instances of the regulator. Afterward, he can set the interval in each instance to fit the needs.
See also: Type constant« Back to Glossary Index