vendredi 27 mars 2015

Design pattern for having custom processing in a generic function

Here is the use case:


I want to develop a rest api to send email so that anyone who want to send email to anybody, can use this api.


Now say one client want to send an email BUT before sending the email, he want to do some book keeping. Say, want to store the sender, receiver information in DB. However, not every client want to store those information.


So, in this case which design pattern will be perfect? I am thinking of using strategy but before that I want to evaluate the options. It would be great help, if anyone provides some input


Aucun commentaire:

Enregistrer un commentaire