Open dselman opened 1 month ago
Do we support primitive types as arguments? e.g.
@TargetConceptProperty(DateTime)
@TargetScalarField(DateTime)
Let's mirror the AST hierarchy for the Target definitions. For example,
concept TargetDeclaration extends Target {}
concept TargetConcept extends TargetDeclaration {}
concept TargetEnum extends TargetDeclaration {}
concept TargetScalar extends TargetDeclaration {}
concept TargetMap extends TargetDeclaration {}
concept TargetProperty extends Target {}
concept TargetConceptProperty extends TargetProperty {}
concept TargetEnumValue extends TargetProperty {}
Feature Request 🛍️
Provide a mechanism to allow the creator of a decorator to indicate (and validate) how it should be used.
Use Case
Decorators are now validated (they must exist and their arguments must be correct) but we do not have a mechanism to ensure that decorators are applied to the correct type of model elements. For example, the author of a decorator may intend that it can be applied to all model elements, only concepts, enumerated values, map keys etc.
Possible Solution
Example usage (the
date
decorator should only be added to concept properties or scalars of typeDateTime
):Context
Provide increased validation for the correct usage of decorators.
Detailed Description
Extend the
concerto.decorators
namespace with some "meta decorators" that can be used to indicate to which model elements a decorator applies.Note that this feature is similar to the
@Target
annotation in the Java programming language: https://jenkov.com/tutorials/java/annotations.html