You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently EmailService receives a PacktFreeOffer, so it is tightly coupled to that domain object.
The following is proposed to loose the coupling:
Create a specific email model class EmailData.
Create a specific EmailService interface with method:
void send(EmailData)
Modify EmailService:
Rename it to SimpleJavaMailService.
Remove NotificationListener interface and add EmailService interface instead.
Adapt the current notify(PacktFreeOffer) method to send(EmailData) method.
Create an adapter class EmailNotifier which will implement NotificationListener interface. This class will send the object to the wrapped inside the EmailData class to the SimpleJavaMailService .
Modify NotifierPacktApplication class to initialize the new EmailListener there instead of the old one.
This task should be priotirized first, as the old task should continue working as before, and then we can do the following tasks.
The text was updated successfully, but these errors were encountered:
- Create specific service for the template engine #59
- Refactor EmailService #53
- Refactor NotificationListener interface #55
- Rename old email template #57
- Rename mail properties to avoid overwritting #60
Currently
EmailService
receives aPacktFreeOffer
, so it is tightly coupled to that domain object.The following is proposed to loose the coupling:
EmailData
.EmailService
interface with method:void send(EmailData)
EmailService
:SimpleJavaMailService
.NotificationListener
interface and addEmailService
interface instead.notify(PacktFreeOffer)
method tosend(EmailData)
method.EmailNotifier
which will implementNotificationListener
interface. This class will send the object to the wrapped inside theEmailData
class to theSimpleJavaMailService
.EmailListener
there instead of the old one.This task should be priotirized first, as the old task should continue working as before, and then we can do the following tasks.
The text was updated successfully, but these errors were encountered: