Hello,

I have a feeling that validator api (or turbine-intake api) is too complicated. Actually it is more implementation than api.

I think, the main thing in validation framework should be validation action itself. Therefore validation framework should define simple and clear interface for validation: e.g.: Validator.

E.g.:
public interface Validator {
public ValidationResult validate(Object, ValidationContext);
}

Implementation of this interface should have no state and it should be thread safe. Then you can define validators which are atomic and reusable even outside this framework.

ValidationResult object can contain message and status (succeeded/failed) of the validation.

ValidationContext can hold a state of the validation. For example, it can indicate if previously performed validations have succeeded. It would be usefull for (non-)performing "expensive" validations.

Does anyone think it would make sence to have such simple validation api? It would be perfect if both commons-validator and turbine-intake use such common interface so you can plug-in your validators to any of them.

Regards
Vilmantas

--
Vilmantas Baranauskas
Phone: +49-711/13353-47 FAX: +49-711/1335353
D A N E T - IS GmbH, Waldburgstrasse 17 - 19, D-70563 Stuttgart
Email: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to