Update 10-Component-Scan.md#11
Open
sky5454 wants to merge 4 commits intoskyline75489:masterfrom
sky5454:patch-5
Open
Update 10-Component-Scan.md#11sky5454 wants to merge 4 commits intoskyline75489:masterfrom sky5454:patch-5
sky5454 wants to merge 4 commits intoskyline75489:masterfrom
sky5454:patch-5
Conversation
source/10-Component-Scan.md
Outdated
| - 而之前的三种 依赖注入(DI) 方式都是通过 XML 来生成 `MyServiceImpl` 的Bean对象,类运行时就是 Bean 对象 | ||
|
|
||
| ```Java | ||
| Main函数中的例子(命名稍微改动,请变通): |
Owner
There was a problem hiding this comment.
这个代码例子是从前面 IoC 那部分拿的吗?我没太懂想表达什么意思...
source/10-Component-Scan.md
Outdated
| > 其实这里的 `MyPersonComponent` 和之前三个 "依赖注入(DI)" 的类是完全不一样的 | ||
| > 对比一下,你会发现前三种DI都是有 sayHello()方法的,而这里的 `MyPersonComponent` 只是代替了 XML 的部分工作,本身并没有 sayHello方法。 | ||
|
|
||
| - 这里的 `MyPersonComponent` 用处:生成`MyServiceImpl` 的Bean对象,代替了 XML 的绝大部分工作,该类本身是和`MyServiceImpl`无关的(没有继承) |
Owner
There was a problem hiding this comment.
这段跟前面一段我大概知道你想表达是什么了,但感觉文字上可以再梳理一下,现在读起来逻辑上感觉有点乱。
前面在讲 该类本身是和MyServiceImpl无关的(没有继承),后面说 而之前的三种 依赖注入(DI) 方式都是通过 XML 来生成,这没有逻辑上的对应性。。。
skyline75489
reviewed
Aug 1, 2019
source/10-Component-Scan.md
Outdated
| **本节代码示例** | ||
| ```Java | ||
| Main函数中的例子(命名稍微改动,请变通): | ||
| 写在Main函数里(命名稍微改动,请变通): |
Contributor
Author
There was a problem hiding this comment.
如果你把前面的类都改了名字,就能发现这段示例挺重要的
Owner
There was a problem hiding this comment.
这段跟 https://skyline75489.github.io/Heart-First-JavaWeb/7-First-Spring-Container.html 这里的最下面那段代码,不一回事吗
skyline75489
reviewed
Aug 1, 2019
source/10-Component-Scan.md
Outdated
| > 对比一下,你会发现前三种DI都是有 sayHello()方法的,而这里的 `MyPersonComponent` 只是代替了 XML 的部分工作,本身并没有 sayHello方法。 | ||
|
|
||
| - 之前的三种 依赖注入(DI) 方式的实现都是: 由 Spring 容器通过 XML 来生成 `MyServiceImpl` 类的Bean对象(类本身就是 Spring 容器操作的对象) | ||
| - 而这里的 `MyPersonComponent` 类只是用来生成`MyServiceImpl` 的Bean对象,它是代替了 XML 的绝大部分工作(这个类本身和`MyServiceImpl`是没有继承关系,所以也没有 sayHello方法) |
Owner
There was a problem hiding this comment.
为什么要强调没有继承关系呢。。其实是没有任何关系啊,都不是一层层面的东西
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.