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
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.
The text was updated successfully, but these errors were encountered:
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 casepackage.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.
The text was updated successfully, but these errors were encountered: