I want to add a notification service to our subscribers. Subscribers will be able to choose your favorite sections. When a new article is published in any of them, it will be sent to them an email with the title of it. We want to provide a solution that avoids docking between subscribers and articles. We have an EMailServer mail server. You do not need to know the details of your configuration, or the sendEMail method. These details are encapsulated in this class, whose Services are accessed through the Singleton pattern application:
The pattern of responsibility is clear to me, I will use observer, but I don't know if I have it well implemented.
I had also thought about implementing the controller design pattern but this generates more doubts about how to translate it into the uml, at the moment my implementation of the observer is the following, I do not know if it is correct:
What I did was, the observer will be the mail server that will notify the subscriber of a new article of his favorite section, while the observable will be related to the specific subject that is the article.
I don't know if it's okay, but that's what comes to mind
Regarding the design pattern, I have more doubts due to the singleton.
Aucun commentaire:
Enregistrer un commentaire