I need to implement a Message Sending functionality based on Roles.
- Role A: Message should be sent by Email and sms
- Role B: Message should be sent by only Email
- Role C: Message should be sent by only sms
- Role D: Message should be sent by Twitter
I have to accommodate for change regarding what Roles can use what Message Sending functionality, e.g. I need to be able to change Role B to also include sms. Any of the Roles may need any of the Message Sending functionality.
I have considered having one Interface IMessageChannel with a method SendMessage. Then three classes implementing that interface, e.g. Email, SMS and Twitter. I am thinking of using the Strategy pattern and Factory? Is this correct?
What Design Patterns should I consider to implement this?