mardi 15 décembre 2015

Java code design pattern for notification service

I have third party service providers for email and sms and now i am integrating it in my application .so before begin designing it i would like to get suggestion for best way of doing it .Here is my basic idea of doing it .I have two interfaces for Notification types and Recipient types.

public interface Notification {

    public int sendNotification(Recipient Recipient);

    public int deleteNotification(int notificationId);

}

and my SMS noty implementation would be like this

public class SMSnotification implements Notification{

    @Override
    public int sendNotification(Recipient Recipient) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int deleteNotification(int notificationId) {
        // TODO Auto-generated method stub
        return 0;
    }

}

Like this i will have other kind of notifications .

Please suggest me if anything could be added or modified in it .

Thanks :)

Aucun commentaire:

Enregistrer un commentaire