Jody Garnett ha scritto: > Andrea Aime wrote: >>> No I would personally register both if we are doing that sort of >>> thing ... >>> >>> I would rather see a "Library" plugin; where a library has >>> implementations (Function?) and descriptions (FunctionName) available. >>> I would personally always create a plain FunctionImpl out of >>> FilterFactoryImpl; the FunctionImpl can hold onto the fallback value >>> (ie the value to use if the function is not found) - and when you >>> call evaluate it can look an implementation then ... much like we do >>> with PropertyName. >> Ok, you totally confused me there. What has function to do with >> property extraction from a feature? > Same design > Factory creates a Property implementation (ie AttributeExpressionImpl ); > inside the PropertyExpression the evaulate method is like the following: >> public Object evaluate(Object obj, Class target) { >> PropertyAccessor accessor = getPropertyAccessor(obj, target); >> ... >> PropertyAccessors.findPropertyAccessor( obj, attPath, target, >> hints ); > See how it looks up a geotools specific plugin (property accessors) in > order to "fill in the implementation" for the AttributeExpressionImpl. > > We can take this same approach with function...
And why in the world would be interested in doing so? Functions seem to me something you evaluate in memory, or encode in some native form using an encoder, just like other expressions and filters. Property extraction is different in that you have many property concepts and many ways to extract them (simple against feature, java bean properties, xpath lookups and whatnot). I don't see the parallel, can you make me an example of how this would be beneficial? Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel