Hi,
I have two, slightly related questions.
First, some background information:
I am working on a tiny e-mail campaign app. It consists of A) a
web/mail-server sending out the e-mails, and B) a windows forms client,
installed on another machine, that does the administration (create new
e-mails, create new campaigns, launch campaigns,...).
Each campaign has a number of users in a table to send e-mails to.
Right now, I was thinking of this structure:
A Windows Service running on the web/mail-server, so the campaigns that are
running can continue after rebooting, etc...
A 'Server' component, that actually dispatches the e-mails. This component
holds a collection of campaigns that are running. After a series of e-mails
has been sent, lets say a batch of 100 messages, it checks for each campaign
the e-mails to start sending, etc...
1)
Here I have two options, and this is my first question:
When the Service starts, it creates an instance of the Server component,
that holds the campaigns collection that are running, and starts the events
needed to send out the e-mails.
or
The service itself holds all the logic (i.e. the methods to refresh the
campaign list, the campaign collection, what event to call to send out
e-mails,...)
2)
In both scenario's, I'd like the Windows Client to communicate with the
Service (put it on hold,...) and/or Server Component (Set a campaign on
hold, add a campaign,...)
Or am I looking too far? Maybe I ought to just make that Service run, let it
instaniate the Server component, and make the Service call, every X minutes,
an event on the Server component, that checks the database for running
campaigns. That way, I don't need to communicate with the service.
What seems to be the best solution?
thanks for any insights, especially on the one where I want a web service to
communicate with the Windows Service
cheers,
Vincent
|