<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_老莫的帐本子_分类_Spring.net</title><id>http://feed.cnblogs.com/blog/u/27825/category/153098/rss</id><updated>2012-06-05T03:33:53Z</updated><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moye/category/153098.html"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/27825/category/153098/rss"/><entry><id>http://www.cnblogs.com/moye/archive/2009/11/27/1611907.html</id><title type="text">一次OSIV调试经历</title><summary type="text">spring.net有一种管理Session以用于lazy-load的模式：Open Session In View（OSIV），原理大致是：spring.net提供了一个HttpModule,“就是一个filter，每次request进来，就打开一个session放到ThreadLocal里，以后用到session就拿出来用，filter结束的时候，再清空ThreadLocal，关闭session”</summary><published>2009-11-27T08:43:00Z</published><updated>2009-11-27T08:43:00Z</updated><author><name>莫耶</name><uri>http://www.cnblogs.com/moye/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moye/archive/2009/11/27/1611907.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moye/archive/2009/11/27/1611907.html"/><content type="text">spring.net有一种管理Session以用于lazy-load的模式：Open Session In View（OSIV），原理大致是：spring.net提供了一个HttpModule,“就是一个filter，每次request进来，就打开一个session放到ThreadLocal里，以后用到session就拿出来用，filter结束的时候，再清空ThreadLocal，关闭session”</content></entry><entry><id>http://www.cnblogs.com/moye/archive/2009/11/09/1599156.html</id><title type="text">Spring.net整合Lucene.net 实现全文检索（附例程）</title><summary type="text">而Lucene.net便是Lucene在dot net平台上的移植版本。关于Lucene的一些概念，有兴趣的朋友可以参考这里。要实现Spring.net与Lucene.net的整合，关键点在于：1、查询时，使用Spring.net集成的nHibernate来管理Lucene.net使用的Session;2、对数据实体的CRUD进行事件监控，以便动态更新索引经过一番尝试，决定将原有的框架进行升级——spring.net 1.2.0 + nHibernaet 2.0.1 + Lucene.net 2.0 + nHibernate.Search。</summary><published>2009-11-09T13:53:00Z</published><updated>2009-11-09T13:53:00Z</updated><author><name>莫耶</name><uri>http://www.cnblogs.com/moye/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moye/archive/2009/11/09/1599156.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moye/archive/2009/11/09/1599156.html"/><content type="text">而Lucene.net便是Lucene在dot net平台上的移植版本。关于Lucene的一些概念，有兴趣的朋友可以参考这里。要实现Spring.net与Lucene.net的整合，关键点在于：1、查询时，使用Spring.net集成的nHibernate来管理Lucene.net使用的Session;2、对数据实体的CRUD进行事件监控，以便动态更新索引经过一番尝试，决定将原有的框架进行升级——spring.net 1.2.0 + nHibernaet 2.0.1 + Lucene.net 2.0 + nHibernate.Search。</content></entry><entry><id>http://www.cnblogs.com/moye/archive/2009/10/27/1590572.html</id><title type="text">code smith模板改进——为实体自动添加数据源描述</title><summary type="text">在 Spring.net Dao的改进——使用属性类描述实体数据源 中，我们借助属性类描述每一个实体，藉此实现Dao的精简。接下来的问题便是，这些实体如果手写工作量还真不小，当然，也可以使用代码生成工具，比如 CodeSmith ，使用方法可参考 一文，这里要说到的是，使用codeSmith在实体模板中编写一些简单的程序语句，使生成的类文件就已经包含数据源的描述元标记（理论上可以无限扩展）。</summary><published>2009-10-27T04:37:00Z</published><updated>2009-10-27T04:37:00Z</updated><author><name>莫耶</name><uri>http://www.cnblogs.com/moye/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moye/archive/2009/10/27/1590572.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moye/archive/2009/10/27/1590572.html"/><content type="text">在 Spring.net Dao的改进——使用属性类描述实体数据源 中，我们借助属性类描述每一个实体，藉此实现Dao的精简。接下来的问题便是，这些实体如果手写工作量还真不小，当然，也可以使用代码生成工具，比如 CodeSmith ，使用方法可参考 一文，这里要说到的是，使用codeSmith在实体模板中编写一些简单的程序语句，使生成的类文件就已经包含数据源的描述元标记（理论上可以无限扩展）。</content></entry><entry><id>http://www.cnblogs.com/moye/archive/2009/10/23/1588721.html</id><title type="text">Spring.net Dao的改进——使用属性类描述实体数据源</title><summary type="text">终于告别一大堆名字不一样的Dao了，统统删掉，这样能让配置文件buessineConfig.xml瘦下来不少，看着舒服。也许看官您会问：如果对于特定的实体要实现事务呢 ——确实，这个Dao只是把通用的部分提炼出来，如果是个性化的操作，还是要单独创建操作类的。比如事务，创建一个基于接口实现的类，加上Transaction元标记，最后，在配置文件中指派Spring.net的某个AOP Proxy对象，让它来帮助你实现事务（在此向以前读过在下糙文的读者致歉，在spring.net中，Transaction元标记只是标注事务的范围，而具体的实现是基于 接口 及 接口切面代理对象 共同完成的) </summary><published>2009-10-23T08:44:00Z</published><updated>2009-10-23T08:44:00Z</updated><author><name>莫耶</name><uri>http://www.cnblogs.com/moye/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moye/archive/2009/10/23/1588721.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moye/archive/2009/10/23/1588721.html"/><content type="text">终于告别一大堆名字不一样的Dao了，统统删掉，这样能让配置文件buessineConfig.xml瘦下来不少，看着舒服。也许看官您会问：如果对于特定的实体要实现事务呢 ——确实，这个Dao只是把通用的部分提炼出来，如果是个性化的操作，还是要单独创建操作类的。比如事务，创建一个基于接口实现的类，加上Transaction元标记，最后，在配置文件中指派Spring.net的某个AOP Proxy对象，让它来帮助你实现事务（在此向以前读过在下糙文的读者致歉，在spring.net中，Transaction元标记只是标注事务的范围，而具体的实现是基于 接口 及 接口切面代理对象 共同完成的) </content></entry><entry><id>http://www.cnblogs.com/moye/archive/2008/11/30/1344369.html</id><title type="text">.net企业级架构实战之7——Spring.net整合Asp.net mvc</title><summary type="text">通过学习Fredrik Normén的经验：《ASP.Net MVC Framework - Create your own IControllerFactory and useSpring.Net for DI 》，我们能知道，要创建自己的ControllerFactory，必须实现System.Web.Mvc的IControllerFactory接口……</summary><published>2008-11-30T09:57:00Z</published><updated>2008-11-30T09:57:00Z</updated><author><name>莫耶</name><uri>http://www.cnblogs.com/moye/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moye/archive/2008/11/30/1344369.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moye/archive/2008/11/30/1344369.html"/><content type="text">通过学习Fredrik Normén的经验：《ASP.Net MVC Framework - Create your own IControllerFactory and useSpring.Net for DI 》，我们能知道，要创建自己的ControllerFactory，必须实现System.Web.Mvc的IControllerFactory接口……</content></entry><entry><id>http://www.cnblogs.com/moye/archive/2008/11/21/1338313.html</id><title type="text">.net企业级架构实战之6——Spring.net管理web services</title><summary type="text">ASP.NET用.aspx文件来保存表示层代码，用code-behind文件中的类保存应用逻辑，.aspx与类代码文件各有分工；但web服务却不同，Web服务的逻辑完全是在code-behind的类中实现的。.asmx文件并没有什么真正的用途，实际上，这个文件既没有必要存在、也不应该存在。 在将WebServiceFactoryHandler类注册为响应*.asmx请求的HTTP Handler之后，开发人员就可以在IoC容器中用标准的Spring.NET对象定义来发布Web服务</summary><published>2008-11-21T04:14:00Z</published><updated>2008-11-21T04:14:00Z</updated><author><name>莫耶</name><uri>http://www.cnblogs.com/moye/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moye/archive/2008/11/21/1338313.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moye/archive/2008/11/21/1338313.html"/><content type="text">ASP.NET用.aspx文件来保存表示层代码，用code-behind文件中的类保存应用逻辑，.aspx与类代码文件各有分工；但web服务却不同，Web服务的逻辑完全是在code-behind的类中实现的。.asmx文件并没有什么真正的用途，实际上，这个文件既没有必要存在、也不应该存在。 在将WebServiceFactoryHandler类注册为响应*.asmx请求的HTTP Handler之后，开发人员就可以在IoC容器中用标准的Spring.NET对象定义来发布Web服务</content></entry><entry><id>http://www.cnblogs.com/moye/archive/2008/11/14/1333902.html</id><title type="text">.net企业级架构实战之5——基于接口的访问层实现</title><summary type="text"> 前几节的内容比较务虚，这一节主要讲讲怎么应用Spring.net和nHibernate及我们写的模板，来搭建一个数据访问层，以及在页面中的调用。这里有一个model（实体）层，一个DAO（数据访问）层，中间还有一个Interface（接口）层。这又回到了最初的探索：接口的做用，一是隐藏实现的细节;二是更利于装配——在spring.net的配置文件中，你可以随时装配一个不同的实现，只要它完成接口规定的方法，好处不言而喻——于页面而言，它并不知道谁来实现了这些功能，它只知道接口的存在（你们都去实现接口吧，我不关心谁在做这件事，要的只是结果！）</summary><published>2008-11-14T14:27:00Z</published><updated>2008-11-14T14:27:00Z</updated><author><name>莫耶</name><uri>http://www.cnblogs.com/moye/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moye/archive/2008/11/14/1333902.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moye/archive/2008/11/14/1333902.html"/><content type="text"> 前几节的内容比较务虚，这一节主要讲讲怎么应用Spring.net和nHibernate及我们写的模板，来搭建一个数据访问层，以及在页面中的调用。这里有一个model（实体）层，一个DAO（数据访问）层，中间还有一个Interface（接口）层。这又回到了最初的探索：接口的做用，一是隐藏实现的细节;二是更利于装配——在spring.net的配置文件中，你可以随时装配一个不同的实现，只要它完成接口规定的方法，好处不言而喻——于页面而言，它并不知道谁来实现了这些功能，它只知道接口的存在（你们都去实现接口吧，我不关心谁在做这件事，要的只是结果！）</content></entry><entry><id>http://www.cnblogs.com/moye/archive/2008/11/09/1330193.html</id><title type="text">.net企业级架构实战之4——Spring.net下的nHibernate数据访问模板</title><summary type="text">DaoTemplate，就是自己写的一个基于以上配置的复杂模板，能完成诸如Distinct，top，调用分页存储过程等一干复杂SQL功能</summary><published>2008-11-09T12:54:00Z</published><updated>2008-11-09T12:54:00Z</updated><author><name>莫耶</name><uri>http://www.cnblogs.com/moye/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moye/archive/2008/11/09/1330193.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moye/archive/2008/11/09/1330193.html"/><content type="text">DaoTemplate，就是自己写的一个基于以上配置的复杂模板，能完成诸如Distinct，top，调用分页存储过程等一干复杂SQL功能</content></entry><entry><id>http://www.cnblogs.com/moye/archive/2008/09/14/1290855.html</id><title type="text">.net企业级架构实战之3——业务对象建模及codesmith模板</title><summary type="text">在软件开发的需求调研完成时，应着手设计业务对象模型。模型应恰到好处地容纳业务对系统的需求——不冗余致拖累系统，不残缺致无法满足业务，因此，建模忠实地反映了调研工作的成效。建模的工具软件有很多，如Rational、Visual Case、UModel，不过本人基本上习惯了PowerDesigner：功能适用，各种模型能自由转化，具有不错的正反向数据库工程能力，还能良好地支持C#。</summary><published>2008-09-14T10:17:00Z</published><updated>2008-09-14T10:17:00Z</updated><author><name>莫耶</name><uri>http://www.cnblogs.com/moye/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moye/archive/2008/09/14/1290855.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moye/archive/2008/09/14/1290855.html"/><content type="text">在软件开发的需求调研完成时，应着手设计业务对象模型。模型应恰到好处地容纳业务对系统的需求——不冗余致拖累系统，不残缺致无法满足业务，因此，建模忠实地反映了调研工作的成效。建模的工具软件有很多，如Rational、Visual Case、UModel，不过本人基本上习惯了PowerDesigner：功能适用，各种模型能自由转化，具有不错的正反向数据库工程能力，还能良好地支持C#。</content></entry><entry><id>http://www.cnblogs.com/moye/archive/2008/08/30/1280192.html</id><title type="text">.net企业级架构实战之2——Spring.net对象装配</title><summary type="text">之所以启用spring.net，看中的是它的容器功能：一个可以管理对象整个生命周期的容器。在这个容器内，我们加入各种对象的定义信息，让它们自动地装配（类似于乐高积木，定制化的拼合）、实例化、事务协作、回收销毁，以适应系统的需要。</summary><published>2008-08-30T09:43:00Z</published><updated>2008-08-30T09:43:00Z</updated><author><name>莫耶</name><uri>http://www.cnblogs.com/moye/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moye/archive/2008/08/30/1280192.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moye/archive/2008/08/30/1280192.html"/><content type="text">之所以启用spring.net，看中的是它的容器功能：一个可以管理对象整个生命周期的容器。在这个容器内，我们加入各种对象的定义信息，让它们自动地装配（类似于乐高积木，定制化的拼合）、实例化、事务协作、回收销毁，以适应系统的需要。</content></entry><entry><id>http://www.cnblogs.com/moye/archive/2008/08/17/1269605.html</id><title type="text">.net企业级架构实战之1——框架综述</title><summary type="text">关于IOC和AOP，以上只是寥寥几笔带过，在以后的实例系列中，将各个击破实例主要围绕的是一个音乐网站的搭建（有点儿像AllMusic内样的，而不同于别的什么无聊SNS社区），会涉及的内容是：Spring.net、nHibernate、codeSmith模板、多对多表结构、Castle MonoRail（虽然有人强建不建议把MonoRail集成到Spring.net中，但我至今没找到.net 2.0下好的MVC解决方案，用用MonoRail有助于更好理解MVC，优化性能）。</summary><published>2008-08-16T17:12:00Z</published><updated>2008-08-16T17:12:00Z</updated><author><name>莫耶</name><uri>http://www.cnblogs.com/moye/</uri></author><link rel="alternate" href="http://www.cnblogs.com/moye/archive/2008/08/17/1269605.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/moye/archive/2008/08/17/1269605.html"/><content type="text">关于IOC和AOP，以上只是寥寥几笔带过，在以后的实例系列中，将各个击破实例主要围绕的是一个音乐网站的搭建（有点儿像AllMusic内样的，而不同于别的什么无聊SNS社区），会涉及的内容是：Spring.net、nHibernate、codeSmith模板、多对多表结构、Castle MonoRail（虽然有人强建不建议把MonoRail集成到Spring.net中，但我至今没找到.net 2.0下好的MVC解决方案，用用MonoRail有助于更好理解MVC，优化性能）。</content></entry></feed>
