Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
-
N/A
Description
I suggest we use varargs in the org.apache.beehive.controls.api.events.EventDispatcher interface. This would make client code that use the method easier to read and easier to contrstuct. The fowllowing is the detail of this suggestion:
Before:
public Object dispatchEvent(ControlHandle target, EventRef event, Object [] args)
throws IllegalAccessException, IllegalArgumentException,
InvocationTargetException;
After
public Object dispatchEvent(ControlHandle target, EventRef event, Object... args)
throws IllegalAccessException, IllegalArgumentException,
InvocationTargetException;
For example, to dispatch a no-arg event, the client code that calls this method would be
dispatcher.dispatchEvent(target, event);
Rather than
dispatcher.dispatchEvent(target, event, new Object[] {});
Similarily, it looks nicer when you have arguments.
Thanks