-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Checking a model for consistency and other errors is one of the most common operations on models.
It might also be expensive: if we wanted to assure globally unique names, we had to check all named things in our model on every name change.
The basic structure of validation is very similar in most systems: any issue has a severity level, refers to a node, might relate to a feature, and provides an error message.
As an example, we might define concepts for Error
, Warning
, and Info
.
My specific validator implementation would create instances of Error
and Info
, but also include a custom compiler-based validation language that defines GeneratorWarning
and CompilerWarning
as specializations of Warning
.
A client that only knows about this validation base language can process both of the specialized warnings in a generic fashion.
Another, compiler-aware client might display GeneratorWarning
s differently than CompilerWarning
s.