On Fri, Apr 29, 2011 at 7:17 PM, Justin Deoliveira <jdeol...@opengeo.org> wrote: > Hi all, > I wanted to continue on with some chat about the FunctionName interface. > Jody recently modified it to return a list of argument names. However as > Andrea noted in that thread it does not give any information about the types > of those arguments. > Well as it turns out for wfs 2.0/fes 2.0 the filter capabilities requires > information about argument type. I could just do something lame and stick in > xs:any or something like that but I figure it might be worth some > modifications to the interface. > Furthermore the spec requires that a function declare its return type as > well. So the idea would be to modify FunctionName as follows: > interface FunctionName { > List<FunctionParameter> getArguments(); > FunctionParameter getReturn(); > } > interface FunctionParameter { > String getName(); > Class getType(); > } > Now Andrea also brought up the issue of functions that take a variable > number of arguments. One possibly solution might be to add some sort of flag > like: > interface FunctionName { > boolean hasVariableArguments(); > } > Or perhaps follow VolatileFunction and come with an interface called > VariableArgumentFunction. Such functions would return an empty argument > list. Or depending on if all the arguments are the same type maybe a single > argument. Actually following this thought maybe a flag on FunctionParameter > makes more sense: > interface FunctionParameter { > ... > boolean isVariable(); > } > > Anyways thoughts?
What about having minOccurs() and maxOccurs() int the FunctionParameter? Just a though, makes it similar to a xml element. Another angle is how to handle the variability. In positional call conventions (such as java) only the last param is allowed to be multivalued, everything else that is multivalued has to be passed in a collection argument. Maybe we can just keep "isVariable()" and have it be legally true only for the last param? Thinking out loud here. There is another consideration I see here. Functions params have always been positional so far, e.g., the first param is the first string to compare the second param is the second one, a eventual third may talk about case sensitiveness, and so on. Once we have named function parameters, are we switching from positional to mapped, name -> value(s)? Does not look like, since we have a List<FunctionName>, but just to be sure :-) Cheers Andrea -- ------------------------------------------------------- Ing. Andrea Aime GeoSolutions S.A.S. Tech lead Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 962313 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.youtube.com/user/GeoSolutionsIT http://www.linkedin.com/in/andreaaime http://twitter.com/geowolf ------------------------------------------------------- ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel