james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harmeet Bedi" <hb...@yahoo.com>
Subject Re: method execution in protocol handlers and alternative ideas on method processing
Date Thu, 22 Mar 2001 09:15:01 GMT
Converted from pattern (1) to (2) for SMTPHandler and POP3Handler. Tested
the changes.
Here are the new converted and tested SMTPHandler and POP3Handler. I am a
new committer but don't have appropriate checkin id(waiting on it). If
someone could check this in, it would be great, otherwise I'll do soon.

thanks,
Harmeet


----- Original Message -----
From: "Harmeet Bedi" <hbedi@yahoo.com>
Sent: Wednesday, March 21, 2001 10:16 PM

If no one has an objection I will convert (1) to (2) where

1.
All the code lies in a single switch statement.
The code pattern is
if method == 'foo':
   do something, read input, alter state, write output
 else if method == 'bar':
   do something, read input, alter state, write output
 else if method == 'shoo':
   do something, read input, alter state, write output
 else if method == 'boo':
   do something, read input, alter state, write output
 else
   unknown state, write error message
 Examples are: POP3Handler, SMTPHandler in James.

 2.
 The execution code for each method is in a separate function.
 The code pattern is
 if method == 'foo':
   doFoo(..)
 else if method == 'bar':
   doBar(..)
 else if method == 'shoo':
   doShoo(..)
 else if method == 'boo':
   doBoo(..)
 else
    doUnknownCommand()


Mime
View raw message