commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vilmantas Baranauskas <>
Subject [validator] It is too complicated
Date Wed, 19 Feb 2003 14:48:24 GMT

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.

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.


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

View raw message