Static Dispatching Only Policy (OOP02)
Level \(\rightarrow\) Advisory
- Category
- Safety:
\(\checkmark\)
- Cyber:
\(\checkmark\)
- Goal
- Maintainability:
\(\checkmark\)
- Reliability:
\(\checkmark\)
- Portability:
- Performance:
- Security:
\(\checkmark\)
Remediation \(\rightarrow\) N/A
Verification Method \(\rightarrow\) Compiler restrictions
Mutually Exclusive \(\rightarrow\) OOP01
Reference
N/A
Description
In this approach, class-wide constructs are allowed, as well as tagged types and type extension (inheritance), but dynamic dispatching remains disallowed (i.e., as in OOP01).
This rule ensures there are no class-wide values passed as the parameter to a primitive operation of a tagged type, hence there are no dynamically dispatched calls.
Note that this rule should not be applied without due consideration.
Applicable Vulnerability within ISO TR 24772-2
6.43 Redispatching [PPH]
Applicable Common Weakness Enumeration
N/A
Noncompliant Code Example
Some_Primitive (Object'Class (X));
Compliant Code Example
Some_Primitive (X);
Notes
N/A