Hi, we've been discussion for quite some time now that feature validation should be disabled. There are quite a few decent arguments pro disabling it: * validation, especially in the new feature model framework using filters for expressing restrictions, is extremely expensive (more on this in another mail) * most feature building code is in the datastores, where we create the feature type by reflecting a native data structure. This means the features we're going to create are valid by creation, there is no need to check them * arguably some usages could accept features that are invalid for a certain amount of time, like code that needs to do a best effort attempt to use the data, or code that might find convient to keep features in an inconsistent state during a long computation (that eventually brings them back in a consistent state).
Nevertheless, disabling validation does not mean removing it completely, but being able to decide where and when to perform it. Validation today occurs in two places: * in feature building, when using SimpleFeatureBuilder * in feature attribute change, since our features are mutable 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. Feature wise, the simplest approach could be to have validation off by default, and add an isValid() method to Feature or, 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 validate attributes). 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? Opinions? Cheers Andrea ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
