CALL FOR: Function Framework
Called by: Pierre van Rooden Total tally on this call : +6
START: 2004/11/23 START OF VOTING: 2004/12/01 15:30 END OF CALL: 2004/12/06 15:30
YEA (6) : Andre van Toly, Michiel Meeuwissen, Marcel Maatkamp, Rico Jansen, Kees Jongenburger, Daniel Ockeloen
ABSTAIN (0) :
NAY (0) :
VETO (0) :
Regarding the getFunctionValue()/createParameters() functions (which can also be called on Function). Your vote on what to do:
Add the new methods (3): Marcel Maatkamp, Rico Jansen, Daniel Ockeloen
Leave out the new methods, deprecate Node.getFunctionValue() (0) :
Leave out the new methods, remove Node.getFunctionValue() (1) : Kees Jongenburger
ABSTAIN (2): Andre van Toly,Michiel Meeuwissen
No votes, assumed abstained (11): Eduard Witteveen, Jaco de Groot, Johannes Verelst, Rob Vermeulen, Nico Klasens, Rob van Maris, Gerard van Enk, Mark Huijser, Ernst Bunders
Result: the vote succeeded.
The hack can be added.
The new getFunctionValue()/createParameter() methods will also be added to the bridge.
Pierre van Rooden wrote:
This is a vote for a hack to expand the Functionframework and add it to the bridge (MMCI).
Full changes are below, and the source is available in the speeltuin cvs.
Note I: Kees made a comment about the getFunctionValue() method not being very 'OO'. While I understand the reasoning, the getFunctionValue() method allready existed in Node.
I feel that if you leave it out on the other classes, you also have to remove it from Node. Hence I need a vote on these methods separately.
Note II: Kees also proposed another way of passing parameters. This is currently not possible (the framework doesn't support it). I may look into this another time though, but I think that would be a separate hack.
This hack is for MMBase 1.8
START OF VOTING: 2004/12/01 15:30 END OF CALL: 2004/12/06 15:30
[_] +1 (YES) [_] +0 (ABSTAIN ) [_] -1 (NO), because : [_] VETO, because:
Regarding the getFunctionValue()/createParameters() functions (which can also be called on Function). Your vote on what to do:
[_] Add the new methods [_] Leave out the new methods, deprecate Node.getFunctionValue() [_] Leave out the new methods, remove Node.getFunctionValue()
I'll implement the choice that gets the most votes.
This hack contains the following changes:
- new methods on Cloud interface (see javadoc in Cloud.java):
public Set getFunctions(String setName); public Function getFunction(String setName, String functionName);
- new methods on Node interface (see javadoc in Node.java): public Set getFunctions(); public Parameters createParameters(String functionName); public Function getFunction(String functionName); public FieldValue getFunctionValue(String functionName, List parameters);
- new methods on Module interface (see javadoc in Module.java): public Set getFunctions(); public Parameters createParameters(String functionName); public Function getFunction(String functionName); public FieldValue getFunctionValue(String functionName, List parameters);
- made interfaces for the function framework. Needed for the RMMCI. the new interfaces are: - Function This interface is a bit different from the class. the methode getNewParameters() is renamed to createParameters() to match the naming scheme of the bridge - Parameters This interface is a bit different from the class. the method hasParameter() has been remamed containsParameter() to match teh naming scheme in List added a few methods, including indexOfParameter() - DataType all references in Function to Parameter or ReturnType are replaced with DataType
Note that these changes won't make much difference for external MMBase code unless you specifically extended the old Function class.
- A new class, WrapperFunction, can be used to wrap another function
(passed to the constructor). The bridge wraps functions, so a 'bridge' function always returns a FieldValue object.
AbstractFunction is the new Abstract implementation of Function. All Function classes extend AbstractFunction. ParametersImpl implements Parameters AbstractDataType implements DataType. ReturnType and Parameter extend AbstractDataType.
- NodeFunction is dropped. Instead, MMObjectBuilder has an inner class 'BuilderNodeFunction', which can be used to quickly define functions that work on Node. It aslo has a NodeFunction as an inner class, which wraps a BuilderNodeFunction using WrapperFunction and passes node as a parameter.
- MMTable (and thus ObjectBuilder) and the core Module class now extend FunctionProvider. FunctionProvider is a new class that provides functionality to register functions (using the addFunction method). It also automatically obtains functions using reflection when the class is instantiated. You no longer need to do this manually (as you used to). The getParameterDefinition method in MMObjectBuidler has been removed. It also provides a default function: "getFunctions", which returns a set of functions.
- moved most of the static methods in NodeFunction and Parameters to the new class Functions. In some cases changed the names of those methods. These methods were only used inside the core (afaik).
- removed all obsolete reflection from FunctionFactory.
- autocasting is now done using the org.mmbase.util.Casting class. The class has been expanded to handle new types, and to handle autocatsing and verification.
- function tags from the taglib will continue to work as normal. Results of a function are automatically cast to the expected type using the Casting class. This makes the tags more flexible (i.e. integers can be cast to boolean now).
- set functions now are nore flexible: both parameters and return types of a set function can be any primitive type or any class.
The code has been tested with the example function tags of the taglibs.
-- Pierre van Rooden Mediapark, C 107 tel. +31 (0)35 6772815 "Some Drink at the Fountain of Knowledge. Others Just Gurgle."
_______________________________________________ Developers mailing list [EMAIL PROTECTED] http://lists.mmbase.org/mailman/listinfo/developers
