如何在Spring.net内部实现依赖项注入? [英] How exactly dependency injection is implemented internally in Spring.net?

查看:117
本文介绍了如何在Spring.net内部实现依赖项注入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道这一点。当我听说Spring.net并尝试了一些DI示例代码时,我发现它很酷,最终我很想知道它是如何工作并在内部实现的?即使将src与框架一起使用,我仍然不足以找出在哪里以及如何完成。

I'm just curious to know about this.When i heard about Spring.net and tried some sample codes of DI i found it cool and eventually i was curious to know how it works and implemented internally? Even though have the src along with the framework i'm not yet good enough to find out where and how it is done.

这与反射有关吗? (这里有Dilbert的话:-一点知识可能太危险了 :-))

Is this something to do with Reflection ? (A Dilbert quote here:- "A little knowledge can be too dangerous" :-) )

推荐答案

了解基本知识注入机制起作用,请查看这个简单的15-LoC依赖项注入容器

To understand how the basic injection mechanism works, take a look at this simple, 15-LoC dependency injection container.

当然,像Spring.Net这样的真实容器要复杂得多。 ,但这是一般想法。

Of course, real containers like Spring.Net are vastly more sophisticated, but that's the general idea.

这篇关于如何在Spring.net内部实现依赖项注入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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