Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor EmailService #53

Closed
9 tasks done
Flashky opened this issue Dec 28, 2018 · 1 comment
Closed
9 tasks done

Refactor EmailService #53

Flashky opened this issue Dec 28, 2018 · 1 comment
Labels
refactor Improve existing code into a cleaner solution

Comments

@Flashky
Copy link
Owner

Flashky commented Dec 28, 2018

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.

@Flashky Flashky added this to the 2.2.0 milestone Dec 28, 2018
@Flashky Flashky added the refactor Improve existing code into a cleaner solution label Dec 28, 2018
Flashky added a commit that referenced this issue Dec 29, 2018
- 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
@Flashky
Copy link
Owner Author

Flashky commented Jun 18, 2019

Done.

@Flashky Flashky closed this as completed Jun 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Improve existing code into a cleaner solution
Projects
None yet
Development

No branches or pull requests

1 participant