Created
February 12, 2014 22:11
-
-
Save ghuntley/8965605 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IMessageGateway | |
{ | |
// will throw exception if sending fails | |
void SendSMS(SMS sms); | |
} | |
------------------------------------------------- | |
public class MessageDispatcher | |
{ | |
private static readonly Logger Log = LogManager.GetCurrentClassLogger(); | |
public IMessageGateway MessageGateway { get; private set; } | |
public MessageDispatcher(IMessageGateway gateway) | |
{ | |
MessageGateway = gateway; | |
} | |
public void SendSMS(SMS sms) | |
{ | |
Log.Info("Sending SMS to message gateway: {0}", sms.ToJson()); | |
MessageGateway.SendSMS(sms); | |
} | |
} |
Author
ghuntley
commented
Feb 12, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment