enumerated types in openEHR

While reviewing the AOM spec, I realised that the enumerated type VALIDITY_KIND contains the constants ‘optional’, ‘mandatory’, ‘disallowed’. The new class I have added ARTEFACT_TYPE contains constants ‘archetype’, ‘template’ etc. I realised that in typical implementations, certainly the ADL parser I maintain, such constant names are likely to be problematic, and probably should be adjusted in some way. In the kind of code I normally write, this would mean for teh VALIDITY_KIND ones - something like vk_optional, vk_mandatory etc; and for the other type, something like at_archetype, at_template, at_template_component etc.

What do other implementers think?

- thomas beale

Hi Thomas,

In the Java implementation, these are implemented as type-safe Java
enumerations. Usually it's good to avoid using types like string or
integer for these enumerated types.

Cheers,
Rong