You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by "Xibin Zeng (JIRA)" <be...@incubator.apache.org> on 2005/08/22 18:19:14 UTC

[jira] Created: (BEEHIVE-893) Change dispatchEvent method signature to use varargs

Change dispatchEvent method signature to use varargs
----------------------------------------------------

         Key: BEEHIVE-893
         URL: http://issues.apache.org/jira/browse/BEEHIVE-893
     Project: Beehive
        Type: Improvement
  Components: Controls  
    Versions: TBD    
 Environment: N/A
    Reporter: Xibin Zeng
    Priority: Minor


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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira