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

Factory Method Pattern #110

Open
wtask opened this issue Jun 29, 2021 · 0 comments
Open

Factory Method Pattern #110

wtask opened this issue Jun 29, 2021 · 0 comments

Comments

@wtask
Copy link

wtask commented Jun 29, 2021

Factory Method Pattern in Go is function which returns an interface (something what is implementing an interface)... that's all. This means you should not think about this pattern and use a pattern when you known patterns. You should make only a function like func NewXXX(arguments) <interface> {...} for your needs (or in ideal case package.New()). And every gofer are making this everyday. And it is not a pattern. This is Interface builder or Interface constructor as you like.
I affirm that Go does not require knowledge of any patterns (as OOP requires), but it requires an understanding of SOLID principles and having a mind.

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

No branches or pull requests

1 participant