You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Andrew Sykes <an...@sykesdevelopment.com> on 2006/01/24 10:38:24 UTC

Command Pattern Generalisation

Stefano,

> A more advanced task could be to generalize the Command Pattern used by 
> the SMTPHandle so that we can use it for all ours telnet/command based 
> protocols like POP3 and possibly as a base for IMAP too.
> The command patter is easy to adopt and it allow for more flexibility 
> extensibility and a cleaner approach to the service creation/deploy.

Can you give an example of the type of generalisation you had in mind?

-- 
Kind Regards
Andrew Sykes <an...@sykesdevelopment.com>
Sykes Development Ltd
http://www.sykesdevelopment.com


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Eclipse

Posted by Andrew Sykes <an...@sykesdevelopment.com>.
It would be good if a .classpath could be added to the repository to aid
importing into Eclipse.

-- 
Kind Regards
Andrew Sykes <an...@sykesdevelopment.com>
Sykes Development Ltd
http://www.sykesdevelopment.com


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Command Pattern Generalisation

Posted by Stefano Bagnara <ap...@bago.org>.
Andrew Sykes wrote:
> Stefano,
> 
>> A more advanced task could be to generalize the Command Pattern used by 
>> the SMTPHandle so that we can use it for all ours telnet/command based 
>> protocols like POP3 and possibly as a base for IMAP too.
>> The command patter is easy to adopt and it allow for more flexibility 
>> extensibility and a cleaner approach to the service creation/deploy.
> 
> Can you give an example of the type of generalisation you had in mind?

STMPHandler could be refactored to be protocol indipendend by moving the 
"mode" to the SMTPSession (or its SMTPSessions.State HashMap) and 
refactoring the loop inside the handleConnection.

POP3Handler could be refactored to use the same code of the SMTPHandler 
but using a different session/state/cmdhandlers.

Stefano

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org