james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harmeet Bedi" <harm...@kodemuse.com>
Subject Re: CommandMap for Handlers
Date Mon, 05 Aug 2002 20:38:56 GMT
This was proposed earlier.

The initial iteration was all the command handing in a single method.
I had proposed 2 alternate ways - separate methods and command map objects.
The latter was vetoed out and I had refactored into separate methods and
left it at that.

I think command map is nice, there are good precedents for example the Slide
project uses this very cleanly to handle DAV HTTP extensions. There is also
lot of similarity between commands like HELO and EHLO that could be more
cleanly expressed by inheritence.

However, I am not sure if this is worth revisiting.. There will find a big
explosion in the number of classes, without much gain.

I would say -1, based on a path that has been discussed and picked.

Harmeet

----- Original Message -----
From: "Noel J. Bergman" <noel@devtech.com>
To: "James-Dev Mailing List" <james-dev@jakarta.apache.org>
Sent: Saturday, August 03, 2002 9:08 PM
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-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:james-dev-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>


Mime
View raw message