例如,魔法属性kernel指向内核,它自动被框架注入到类中。
For example, the magic attribute kernel refers to the kernel, which is automatically injected into the class by the framework.
对于更大型的程序,我更愿意做外部引用或者使用依赖注入框架。
For larger applications, I prefer to wire in that reference externally or use a dependency injection framework.
我可不想让依赖注入框架的代码散布在我的应用当中。
I don't want [Dependency Injection] framework code smeared all through my application.
应用推荐