Problem keeps being that validation is not taking place in the factory nor in the builder, but in the attribute itself.
Possible paths are: - moving validation to the builder - moving validation to the factory I'm sort of more advocate for the builder, and by its own nature it could have a flag to indicate whether or not to run validation. I guess that also fits with the idea of not putting logic on the factories, which's something I seem to recall we were looking for? cheers, Gabriel On Thursday 22 November 2007 05:25:46 pm Jody Garnett wrote: > I am with you man; I just wish we could leave it on a while longer. Darn > projects starting up on trunk ;-) > > One good way to "switch" would be to have a strict factory and a normal > factory; and then use the usual global hints thing to choose. > > For this to work we would need to take the validation out of the builder > ... Jody > > > Ahhh...my favorite debate, to validate or not to validate. > > > > First off, my opinion is that i think it is probably best to not > > validate unless the user / application asks for it. Like for the > > rendering case you probably want to be somewhat lax about the content in > > these cases. Where as for editing / transactions you want to be strict. > > > > However, while i made the feature model switch i left it on because it > > was a good way to catch cases where backward compatibility was being > > violated. > > > > So i would be ok with turning it off... we however need a good way for > > the user to ask for it. Currently the api has no validate method, > > although i think there is a utility method somewhere. > > > > Anyone else have any thoughts? > > > > -Justin > > > > Gabriel Roldán wrote: > >> Hi, > >> > >> I'm getting trapped by validation. Thing being that AttributeImpl > >> constructor calls Types.validate(this, getValue()), which fails to > >> validate, for example, a double value. > >> Example: > >> I've inserted a double attribute in sde with the value 0.7 > >> The attribute has a length "restriction" (aka, Filter) of 15. > >> Now, when I fetch the attribute from the database, it's > >> 0.700000000000001, hence the validation fails. > >> > >> Question is: > >> - does anybody got trapped in the same way? how to solve it? > >> - should I check the attribute content is valid before creating the > >> Attribute? - should that kind of validation not occur at all when > >> fetching data, but just when inserting/modifying? > >> > >> hrmmm... > >> > >> Gabriel > >> > >> > >> !DSPAM:4007,4745a6cb279761030819293! ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
