I want to create a "modules" layout in my web application so I can easily add more modules of the same type, for example:
As an example, my WebApp handles subscriptions and email campaigns, and I want to create an interface to allow easily coupling multiple API's, MailChimp, CampaignMonitor, iContact, etc...
so I will create an IMailingService
interface where I set up the ground rules and all modules will implement it like
public class CampaignMonitorService : IMailingService
So far so good...
How about fire the interface method upon an action on my webapp?
Should I implement the Observer Design Pattern, should I simple create event handlers, or any other hook?
for example, upon a user subscription I would like to fire the AddSubscriber
method on the interface
AddSubscriber(string email, string[] args);
some thing as creating a list, unsubscribing, etc, etc...
What would be the best approach to handle such scenario?