如何在Spring.net内部实现依赖项注入?

编程入门 行业动态 更新时间:2024-10-10 14:27:30
本文介绍了如何在Spring内部实现依赖项注入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

I'm just curious to know about this.When i heard about Spring 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内部实现依赖项注入?

本文发布于:2023-11-06 01:59:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1562431.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   Spring   net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!