You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Boris Burtin <bb...@zimbra.com> on 2008/10/02 20:16:51 UTC

jSieve 0.2 API feedback

Thanks for releasing jSieve 0.2.  I've been playing around with it for the last couple of weeks.  I got things working without too much trouble, but did find a few areas that I think could be improved.  Thought I'd send around this list, in case you guys find it useful when working on the next version.

1) The ConfigurationManager API currently exposes the Map that's read from the properties file.  The caller adds extensions by using class names instead of Class objects.  It would be better to have API's that accept Class<? extends ExecutableTest> and Class<? extends ExecutableCommand> for better type checking at compile time.

2) Collections in API signatures should be parametrized.  It makes life much easier when I know the type of the objects stored in a List or Map.

3) MailAdapter.getContent() should return an InputStream or Reader.  Currently it returns an Object, which the Body test assumes is a String.  This is ok 99.9% of the time, but I don't want to risk an OOME if I ever have to process a message with a huge body.

Thanks again for the great work on jSieve!

Boris

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


Re: jSieve 0.2 API feedback

Posted by Robert Burrell Donkin <ro...@gmail.com>.
hi boris

On Thu, Oct 2, 2008 at 7:16 PM, Boris Burtin <bb...@zimbra.com> wrote:
> Thanks for releasing jSieve 0.2.  I've been playing around with it for the last couple of weeks.  I got things working without too much trouble, but did find a few areas that I think could be improved.  Thought I'd send around this list, in case you guys find it useful when working on the next version.

thanks (i've opened JIRAs to record this information)

there are number of areas in the API that we've been working to
improve since the release 0.2

if you have the time, check out
http://svn.apache.org/repos/asf/james/jsieve/trunk/ and tell us what
you think

> 1) The ConfigurationManager API currently exposes the Map that's read from the properties file.  The caller adds extensions by using class names instead of Class objects.  It would be better to have API's that accept Class<? extends ExecutableTest> and Class<? extends ExecutableCommand> for better type checking at compile time.
>
> 2) Collections in API signatures should be parametrized.  It makes life much easier when I know the type of the objects stored in a List or Map.

ATM jsieve supports version of java before 0.5

genertics are very useful in crafting better APIs but this would need
to be weighed against loss of compatibility. perhaps we could use
retroweaver.

> 3) MailAdapter.getContent() should return an InputStream or Reader.  Currently it returns an Object, which the Body test assumes is a String.  This is ok 99.9% of the time, but I don't want to risk an OOME if I ever have to process a message with a huge body.

yes, MailAdapter.getContent should be replaced. i lean towards an
explicit search call to all implementations to optimise.

- robert

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