Andrea Aime wrote:
> Validation today occurs in two places:
> * in feature building, when using SimpleFeatureBuilder
> * in feature attribute change, since our features are mutable
>   
I kind of figure that the attribute change validation check should be an 
implementation option; ie off by default. If you really want to have 
this make use of a seperate FeatureFactory that performs such checks 
StringFeatureFactory as it were.
> Shall we decide to have validation configurable, how
> do we want it? Builder wise, we can simply add a
> flag to the feature builder so that it will perform
> validation during feature building, or not.
>   
Can this be done setting up the builder with either the 
FeatureFactoryImpl or the StrictFeatureFactory. No need to get 
complicated? Or is the builder performing more checks than could be 
handled in the StrictFeatureFactory create methods?
> Feature wise, the simplest approach could be to have validation off by 
> default, and add an isValid() method to Feature or.
I don't mind adding an isValid() method to Attribute - ie do that and it 
will show up in Feature. But the implementation should be captured in a 
common spot - say Types for GeoTools developers. Given that that this is 
a good idea we "may" be able to leave it out of the GeoAPI interfaces? if we
> don't want to change the Feature interface, to have a feature validation 
> method in Types (the utility class that we already use to validateattributes).
>   
Just so.
> An alternative for builders would be to have a system wide hint that the 
> builder would check. This would allow a "strict" mode for testing and a 
> production mode for performance?
>   
A system wide Hint for the default behaviour may be okay; I am more 
interested in using this on a Query by Query basis. Note some datastores 
like WFS make use of a special FeatureFactory in order to be even more 
lax; it is able to handle out of order attributes etc...

All the best,
Jody

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to