-----Original Message-----
From: Jason Hunter <[EMAIL PROTECTED]>

>(Please pardon me while I pick apart JavaMail.  I realize we're really
>leaving the servlet arena now, but apparently this topic has generated
>at least a certain amount of interest on this list.)


I agree that the APIs could have been simplified, but the points you made
seem rather simple to resolve by either subclassing or even better, wrapping
the APIs to meet your own needs.

Personally, I found the APIs to be a bit inconsistent considering they are
standards-track, but in defense of JavaMail, it is a full fledged mail API
for both sending and receiving email for SMTP and POP3 (I think!).  Such
APIs are generally rather cumbersome because they themselves are wrappers
for known protocols like SMTP and POP3, and those are not object-oriented to
begin with. If they made them "too elegant," than you'd likely miss some of
the functionality those protocols offer.

As an example, RMI is quite simple, but it's also a real pain in the neck
for serious development.  Can you timeout an API call?  No.  Can you use UDP
instead of TCP?  No.   Can you control socket creation or destruction?  No.
Can you get notification as soon as there is a datacom error? No.   These
things can all be done with regular socket programming, but it is more
tedious and RMI is simple.

So, the point is there is a toss-up in trying to create APIs that are both
powerful and easy.  My preference is to have a simple API AND a detailed
API, such that you can do simple, common tasks very easily and you can do
complex things by using 'factories', 'object plugins' and 'callback
interfaces' and such to allow for fine tuning.

JavaMail seems to have pleased neither side.  However, without too much
work, creating a SimpleEmail class that uses JavaMail could solve the needs
of those who prefer a simpler API.

David

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to