method pointers!
but Java choose innerclasses/interfaces approache for that... :(
new Link("bla", new ActionHandler());
But then the code is jus as big because you need to make that action handler... (which implements an interface)
So in the end result is the same.
it would be really cool if you could do in java just his:
class X
{
X()
{
new Y(callMethod); // no () !
}
private String callMethod()
}
class Y
{
Y(ObjectMethod method)
{
String ret = method.call();
}
}
On 4/1/06, Jonathan Locke
<[EMAIL PROTECTED]> wrote:
this suggestion (which is implementable in a user code
regardless of what goes into the core)
add(new ReflectionLink("myLink", "myMethod"))makes me wonder if Java couldn't use a reflection notation
similar to "object.class" to specify Method objects, like
"myMethod.method". then you could do this both conveniently
and safely like this:
add(new MethodLink("myLink", myMethod.method))
or even just
add(new MethodLink(myMethod.method))
which would assume the link is named myMethod...
too bad "method" isn't a reserved keyword.
