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

Optimize the template method pattern, call genAndSendOTP function by concrete product class #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wuye251
Copy link

@wuye251 wuye251 commented Feb 21, 2023

Hello
When I was learning about the template method pattern from your book, I found that the code implemented by go might have a better way to call it, concrete's genAndSendOTP can use concrete instead of concrete template class or base class. The way to call will better.

eg: smsOTP.genAndSendOTP(4) instead of o.genAndSendOTP(4)

@wuye251 wuye251 changed the title upgrade template call genAndSendOTP function by concrete product Optimize the template method pattern, call genAndSendOTP function by concrete product class Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant