对<<Spring.NET和Nhibernate开发程序的点滴(1) >>的部分解释
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</sectionGroup>
</configSections>
1.Spring.NET框架的核心原则是非侵入性, 所以有两种方法创建容器.
1).在代码中使用new操作符来显式创建容器
2).在.NET应用程序的标准配置文件中用一个自定义节点来配置容器, 这次学习采用第二中方法.
3).Spring.Context.Support.ContextHandler是继承IConfigurationSectionHandler接口的,IConfigurationSectionHandler接口望文生义就是"配置节点处理者". ContextHandler就是处理配置文件中的<Spring><Context></Context></Spring>节点. 它使ContextRegistry类既可初始化应用程序上下文,也可以服务定位器风格对容器中的对象进行访问.否则Spring.NET无法自动处理应用程序上下文的配置信息,也无法使用ContextRegistry对容器进行访问。
2. 在NET应用程序的标准配置文件为容器配置对象定义.Spring.Context.Support.DefaultSectionHandler也是从IConfigurationSectionHandler接口继承来的,跟ContextHandler不同,它是用来处理容器里的对象定义的.处理节点<Spring><objects></objects></Spring>
3.说明一下IApplicationContext, WebApplication,XMLApplication三者是什么,有何不一样.