Great idea.
The IMAP Commands are called as the same way.
> -----Original Message-----
> From: Noel J. Bergman [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, August 04, 2002 6:08 AM
> To: James-Dev Mailing List
> Subject: CommandMap for Handlers
>
>
> I am proposing the inclusion of a CommandMap, which we can
> use in our Handlers. A prototypical use of the command map
> would look like:
>
> // initialize the command map
> commands = new CommandMap(new CommandMap.Command()
> {
> public do(String command, String argument, String
> argument1)
> { // implementation of default command
> }
> });
> commands.add(<command>, new CommandMap.Command()
> {
> public do(String command, String argument,
> String argument1)
> { // implementation of <command>
> }
> });
>
> e.g.,
>
> commands.add("USER", new CommandMap.Command()
> {
> });
> commands.add("PASS", new CommandMap.Command()
> {
> });
>
> Later, when we have a command, it is invoked as:
>
> commands.do(command, argument, argument1);
>
> This would simplify code, potentially speed up code,
> modularize the code, improve readability, and allow us to add
> additional things to the CommandMap.Command class such as
> stats, per command log strings, etc.
>
> Comments?
>
> --- Noel
>
>
> --
> To unsubscribe, e-mail:
> <mailto:james-dev-> [EMAIL PROTECTED]>
> For
> additional commands,
> e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>
>
>