6 Replies Latest reply on Apr 7, 2008 6:22 AM by tom.baeyens

    use generics in commands

    porcherg

      In the current pvm, command and command executor return Object.
      With this approach, the user has to cast the result to use it.

      Maybe we can change the command interface to a generic interface Command< T >, the execute method would return a T object.

      public interface Command<T> extends Serializable {
       T execute(Environment environment) throws Exception;
      }

      This way, a user directly knows the class of the returned object.

      What do you think of this modification ?

      regards,
      Guillaume