I have a class, ClassA
that uses a client I wrote to send text messages, TextClient
, to send some text messages via a call to the static method
TextClient.Send(string text, string destination)
// where destination is a phone number
However, I also have a mail client class, MailClient
, which sends emails with the same signature:
MailClient.Send(string text, string destination)
// where destination is an email address
I would like to "inject" which of these clients should be used - is this possible?
(Note: I'm aware of problems that might arise when there are entirely different rules for what values destination
can hold and be considered valid, but the values are fetched from someplace else, so this class doesn't need to bother. That's why I want to abstract this away in the first place.)