在scala中怎么做依赖注入? [英] How would one do dependency injection in scala?

查看:136
本文介绍了在scala中怎么做依赖注入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我还在开始学习scala,除了java,我没有得到它应该在DI做DI吗?可以或应该使用现有的DI库,是否应该手动完成或还有另一种方式?

解决方案

标准Java DI框架通常会使用Scala,但您也可以使用语言结构达到相同的效果没有外部依赖关系。


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 be done manually or is there another way?

解决方案

Standard Java DI frameworks will usually work with Scala, but you can also use language constructs to achieve the same effect without external dependencies.

这篇关于在scala中怎么做依赖注入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆