You probably don't need a DI framework in Golang

a year ago by cm0002 to c/golang

When working with Go in an industrial context, I feel like dependency injection (DI) often gets a bad rep because of DI frameworks. But DI as a technique is quite useful. It just tends to get explained with too many OO jargons and triggers PTSD among those who came to Go to escape GoF theology. Dependency Injection is a 25-dollar term for a 5-cent concept. — James Shore DI basically means passing values into a constructor instead of creating them inside it. That’s really it. Observe:
xtapa 1 point a year ago

That's what bugged me when I had a job where I had to use C#. Go DI was so simple, C#/.net DI felt unnecessarily complicated with a lot of magic happening.

path: 0 17451309, hotness: undefined, score: 1, children: 0
golang
golang

@programming.dev

login for more options
2784
317
26

This is a community dedicated to the go programming language.

Useful Links:

Rules:

  • Posts must be relevant to Go
  • No NSFW content
  • No hate speech, bigotry, etc
  • Try to keep discussions on topic
  • No spam of tools/companies/advertisements
  • It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.

go to feed...