Limitations of the Manifest Model
The manifest model provides a simplified API which is well-suited to serialization. This introduces a number of limitations into the validators that a manifest model may describe.
Limitations upon child values
When using a validator builder or when using the validation manifest directly, it is possible to use arbitrary accessor logic to derive child values.
- In a builder you would use
ForValue
orForValues
- In the manifest you would set
ManifestItem.AccessorFromParent
to an arbitrary function
Using the manifest model you may only specify the string
name of a member by which to access the child value.
This could be public property, field or parameterless method.
You may not use arbitrary logic to access child values.
No type safety
It will be apparent when using a validator builder that it is a type-safe API. This allows IDE auto-completion (aka "Intellisense") of validated properties. It also provides compile-time checking of types, accessors and rule selections.
The Manifest Model does not provide this type safety. This means that it is easier to accidentally create a faulty validation manifest, which will raise exceptions when used at runtime.