Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 0.6
-
Fix Version/s: 0.8
-
Labels:None
Description
Currently the validatable objects need implement Validatable, which mandates a buildValidation() methods.
Instead, see if its possible to pass a Functor that encapsulates what "build validation" method is to be called, and this will be applied across the object graph, building the validation object.
This will allow the caller have a family of build validation methods, for use in different contexts.
It just feels better, and is worth trying.
maybe look at sticking an annotation on the validation rule definition methods. The annotation can optionally have tags. When collecting the validation rules, the default is to use any method with the annotation, but the caller can optionally specify which of the tags (associated with the annotation) to look at.