hi,

ReferencingStrategy is an internal concept (that's the reason why it isn't
public and there is the marker "UsageCategory.INTERNAL").
(yes - the name should be different - at the beginning the plan was to
implement exactly what you mentioned - but in the end there were some
special reasons for changing the implementation, however, the name remained
the same - but it's just a name for a temporary solution.)

anyway, you are right (and as you see we are aware of it) - it should be
separated.
(that was the main reason for keeping it as an internal
implementation. furthermore, we have to take care that a
custom ReferenceResolver implementation won't break the compatibility with
existing validation modules.)

it's planned to impl. something like a ReferenceResolver in v4.

the idea is to introduce a pluggable mechanism which allows to provide
custom implementations for implementing a custom syntax for such references
or a typesafe alternative.

the current (clean) point for customizations is one step before
(AbstractCompareStrategy#processCrossValidation).
so it's possible to override it for implementing a custom mechanism without
the ReferencingStrategy interface.

you are welcome to open a new section in the wiki [1] and prototype the
implementation.

regards,
gerhard

[1] http://wiki.apache.org/myfaces/Extensions/Validator/DevDoc/Drafts

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


2010/1/14 Rudy De Busscher <[email protected]>

> hi all,
>
> The cross validation feature makes usage of the *ReferencingStrategy 
> *implementations
> to find the other value for the comparison in the validation.  The method
> *evaluateReferenceAndValidate *implements 2 kinds of functionality the
> evaluation of the reference  and the validation (as the name indicates)
>
> Shouldn't it be better that the *ReferencingStrategy *should only be used
> for the evaluation of the references and that the call to the validations
> (as it is already performed by the 
> *CrossValidationHelper*.*crossValidateCompareStrategy
> *method) is made from the *AbstractCompareStrategy*.
>
> The goal is that the *ReferencingStrategy *and implementations are
> independent of the Cross validation feature so that they could be reused
> (I'm thinking about a multiFieldValidation, more info follows) and a clearer
> design is created.
>
> I analyzed the usage of the different parameters and it should be possible
> to have a method
> *EvaluatedReference evaluateReference(MetaDataEntry metaDataEntry,
>             String validationTarget);*
>
> that make the evaluation of the contents in validationTarget. The 
> *EvaluatedReference
> *contains a reference to the *ProcessedInformationStorageEntry*, if it was
> a *modelAwareEvaluation *and some other indications required in the Cross
> compare validation method.
>
> All the required changes are made to classes marked as
> UsageCategory.INTERNAL so refactoring shouldn't have any impact on users  of
> the framework.
>
> Regards
>
> Rudy De busscher

Reply via email to