是否有可能采用与统一方法注入时,覆盖的参数值? [英] Is it possible to override parameter values when using Method Injection with Unity?

查看:228
本文介绍了是否有可能采用与统一方法注入时,覆盖的参数值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

报告说,在Unity手动...

It says in the Unity manual...

ParameterOverride只能用于构造。

ParameterOverride can be used only for constructors.

那么,为什么是方法的参数冷落?

So why are the parameters of methods left out?

欢呼声中,伊恩。

推荐答案

我离开它的原因,坦白地说,是发展和放大器;测试时间,再加上​​用于注射的方法很多,除了构造函数或财产注入少得多的事实。特别是,我们的测试和文档队被他们的指甲抱着试图跟上的东西,我把他们,因为它是。

The reason I left it out, quite honestly, was development & test time, plus the fact that method injection is used much, much less than constructor or property injection. In particular, our test and doc teams were holding on by their fingernails trying to keep up with the stuff I was throwing them as it was.

有没有技术理由离开它。在覆盖对象是可扩展的,所以这是完全合理的创建自己的覆盖方法的参数值,如果你真的需要它。

There's no technical reason to leave it out. The Override objects are extensible, so it's perfectly reasonable to create your own to override method parameter values if you really need it.

这篇关于是否有可能采用与统一方法注入时,覆盖的参数值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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