Difference between revisions of "Core.Declarations.GlobalDeclarations"

From emotive
Jump to navigation Jump to search
Line 46: Line 46:
  
 
== See also ==
 
== See also ==
[[Core.OtxValidation|Validation (OTX-Checker)]] <br/>
+
[[Core.Validation|Validation (OTX-Checker)]] <br/>
​​[[General.OtxNamingConventions|Naming Conventions]] <br/>
+
​​[[General.NamingConventions|Naming Conventions]] <br/>
[[Core.OtxImports|Imports]] <br/>
+
[[Core.Imports|Imports]] <br/>
[[Core.OtxVisibilities|Visibilities]] <br/>
+
[[Core.Visibilities|Visibilities]] <br/>
[[Core.OtxValidities|Validities]] <br/>
+
[[Core.Validities|Validities]] <br/>
[[Core.OtxSignatures|Signatures]] <br/>
+
[[Core.Signatures|Signatures]] <br/>
[[Core.OtxParameters|Parameter Declarations]] <br/>
+
[[Core.Parameters|Parameter Declarations]] <br/>
[[Core.OtxProcedures|Procedures]] <br/>
+
[[Core.Procedures|Procedures]] <br/>
[[Core.OtxComments|Comments]]
+
[[Core.Comments|Comments]]

Revision as of 10:42, 16 February 2016

Classification

Name Global Declarations
Short Description Global variables and constants
Class OTX Core
Pre-Conditions -
Specified by ISO 13209-2

Introduction

The following elments can be declared in the global declaration block:

  • Global Constants
  • Context Variables
  • Document Variables

These elements have a global scope. That is, they can be used within the document in which they are declared, as well as in other documents, see Imports.

Semantics

Global Constant

The value of a global constant is set at design-time and can not be changed at runtime. The global constants must have one of the following Visibilities:

  • Private (default)
  • Package
  • Public

A constant has a Type and a value corresponding to the type.

Global Variable (Document Variable)

The value of a global variable can be changed at runtime. Global variables can only be used in the same document. Therefore, they only have one following Visibility:

  • Private (fixed)

A variable has a Type and an initial value (default value) corresponding to the type.

Environment Variable (Context Variable)

Context variables behave like global constants. However, they have a special meaning. They represent environment-related data, such as vehicle type, name of workshop, user login name, etc., see the Context Concept. The context variables must have one of the following Visibilities:

  • Private (default)
  • Package
  • Public

A context variable has a Type and a default value corresponding to the type.

Checker rules

Core_Chk009 Mandatory constant initialisation
Core_Chk051 Immutability of constants, input parameters and context variables
Core_Chk052 Identifier shadowing

See also

Validation (OTX-Checker)
​​Naming Conventions
Imports
Visibilities
Validities
Signatures
Parameter Declarations
Procedures
Comments