How would one do dependency injection in scala?

前端 未结 9 1627
鱼传尺愫
鱼传尺愫 2021-01-30 12:25

I\'m still at the beginning in learning scala in addition to java and i didn\'t get it how is one supposed to do DI there? can or should i use an existing DI library, should it

9条回答
  •  野的像风
    2021-01-30 13:06

    In addition to the answer of Dan Story, I blogged about a DI variant that also uses language constructs only but is not mentioned in Jonas's post: Value Injection on Traits (linking to web.archive.org now). This pattern is working very well for me.

提交回复
热议问题