How exactly dependency injection is implemented internally in Spring.net?

你。 提交于 2020-01-06 01:56:37

问题


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.

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


回答1:


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

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



来源:https://stackoverflow.com/questions/1082898/how-exactly-dependency-injection-is-implemented-internally-in-spring-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!