No Class-wide Constructs Policy (OOP01)
Level Advisory
Category : Safety: :
code
Cyber:
: Goal : Maintainability: :
code
Reliability:
:
Portability:
Performance:
Security:
: Remediation N/A
Verification Method Compiler restrictions
Mutually Exclusive OOP02
Reference
N/A
Description
In this approach, tagged types are allowed and type extension (inheritance) is allowed, but there are no class-wide constructs.
This restriction ensures there are no class-wide objects or formal parameters, nor access types designating class-wide types.
In this approach there are no possible dynamic dispatching calls because such calls can only occur when a class-wide value is passed as the parameter to a primitive operation of a tagged type.
Applicable Vulnerability within ISO TR 24772-2
- 6.43 Redispatching [PPH]
Applicable Common Weakness Enumeration
N/A
Noncompliant Code Example
ada
X : Object'Class := Some_Object;Compliant Code Example
ada
X : Object := Some_Object;Notes
The compiler will detect violations with the standard Ada restriction
No_Dispatch applied.