Well, seems that you've got your answer. That's the beauty of object
orientation. Isn't it?. Easier maintenance. You might want to clean up
a little bit the 'cut and paste' part of it.
Just a quick remainder, if allowed, since you say you have not worked
that much on JEE space. A mail session should be treated much like a
database connection. Apart from the pooling practices, be prepared for
a mail transaction to take obscene amounts of time, and be prepared to
retry. Any mail server can just say "try again later" at any time; and
can take forever to decide whether to accept or reject a message.

On Thu, Mar 5, 2009 at 9:15 AM, Adam Brons <ambr...@gmail.com> wrote:
>
> Hey Everyone,
>
> I justed figured I'd throw this out there and see if any of you have
> done something similar or think the path I'm taking is bad.
>
> I recently started working on a Web Application using GWT, JAX-WS, EJB
> 3, ETC.  I've done a lot of development on JSE, but not much beyond
> JMS, Servlets, and JSP in the JEE space.
>
> As I was tasked with creating a new service to allow some form of
> Emailing to the customer I noticed that we're using roughly the same
> code "cut and pasted" in all of these individual web services for
> emailing "this and that" to the customer.  As part of this mailing
> each of these services is attaching items to the mail message, and
> using a template style setup for taking a generic message and
> personalizing it. We have an Email class with the basics in it,
> standard header information, attachements, etc. What the class doesn't
> do is handling transforming the temple style body.
>
> So my thought is to extend the Email class to support each of the
> individual cases for sending email and have the logic for transforms
> the email, getting access to the mail service, etc encapsulated in
> these subclassed version of the Email message.
>
> Any thoughts?
> -Adam
> >
>



-- 
Marcelo Morales

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javaposse@googlegroups.com
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to