samedi 5 décembre 2015

How can i change following interface to accept parameters for different types of messaging system. any design pattern ?

public interface IsendMessage {
public void send(messageContext context);
}

Above interface is for sending message. it can be email, SMS , JMS. here method parameter accepts messageContext.

how can i make that generic to accept parameters for all type of messages. like email we have to, from , password, attachement , smtp server properties

But SMS has different properties . so how can i make that interface generic so that. EmailSender and SmsSender can implement this IsendMessage interface to send messages.

Any design pattern can be used here ?

Aucun commentaire:

Enregistrer un commentaire