<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_风云_分类_NLite</title><id>http://feed.cnblogs.com/blog/u/13626/category/292717/rss</id><updated>2012-06-04T02:01:27Z</updated><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/netcasewqs/category/292717.html"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/13626/category/292717/rss"/><entry><id>http://www.cnblogs.com/netcasewqs/archive/2012/05/21/2511531.html</id><title type="text">Mini 容器泛型类型的使用</title><summary type="text">今天在群中有人问关于泛型类型的注册和使用。我在这里做一个简单的Demo例子ServiceRegistry.Current .Register(typeof(IList&lt;&gt;),typeof(List&lt;&gt;));//注册契约 IList&lt;&gt;,组件List&lt;&gt;Assert.IsTrue(ServiceRegistry.HasRegister(typeof(IList&lt;&gt;)));Assert.IsTrue(ServiceRegistry.HasRegister(typeof(IList&lt;int&gt;)));Assert.IsTrue(S</summary><published>2012-05-21T05:45:00Z</published><updated>2012-05-21T05:45:00Z</updated><author><name>风云</name><uri>http://www.cnblogs.com/netcasewqs/</uri></author><link rel="alternate" href="http://www.cnblogs.com/netcasewqs/archive/2012/05/21/2511531.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/netcasewqs/archive/2012/05/21/2511531.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/netcasewqs/archive/2012/05/12/2497638.html</id><title type="text">给Web Api 再加把柴-让它更火起来</title><summary type="text">WebApi 这两天被dudu老大炒的老火了，看来我也需要加把柴了，呵呵。 Ndf WebApi 是基于Ndf的服务分发器引擎，并借助Asp.net 的http原生态无状态协议的基础上搭建起来的，简单易用，不废话，上过程！ 服务端Ndf Web API的实现 需要准备的工具：Visual Studio 2010, NuGet(这两天现学了Nuget 包的制作，虽然去年简单学习并制作了NLite的包，不过早忘光了，看了dudu老大的WebApi介绍，感觉落伍了，抓紧进行了恶补，总算制作了一个NdfWeb Api的Nuget 包了呵呵，在这里要多谢dudu了） 1. 新建一个空的ASP....</summary><published>2012-05-12T15:14:00Z</published><updated>2012-05-12T15:14:00Z</updated><author><name>风云</name><uri>http://www.cnblogs.com/netcasewqs/</uri></author><link rel="alternate" href="http://www.cnblogs.com/netcasewqs/archive/2012/05/12/2497638.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/netcasewqs/archive/2012/05/12/2497638.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/netcasewqs/archive/2011/12/19/2293615.html</id><title type="text">松耦合服务调用利器-服务分发器</title><summary type="text">引言 对象和对象之间是通过消息来进行通信的。具体过程如下： 创建对象a 创建对象b 创建请求消息request 调用对象b的方法 对象b返回对应的response通过上面的过程可以看出通信的调用方需要依赖如下元素：被调用方 （服务契约）请求消息request( 数据契约）被调用方的方法（操作契约）响应消息（数据契约）那么我们可以把通信的过程通过引入一个间接层-服务分发器来解耦对象间的之间通信，具体过程如下： 创建对象a 创建服务分发器dipatcher 创建请求消息request 调用分发器的分发方法 分发器创建对象b,并调用对象b的方法 对象b返回对应的response 给分发器，分发器把.</summary><published>2011-12-19T09:23:00Z</published><updated>2011-12-19T09:23:00Z</updated><author><name>风云</name><uri>http://www.cnblogs.com/netcasewqs/</uri></author><link rel="alternate" href="http://www.cnblogs.com/netcasewqs/archive/2011/12/19/2293615.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/netcasewqs/archive/2011/12/19/2293615.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/netcasewqs/archive/2011/12/19/2293144.html</id><title type="text">为ASP.NET MVC创建一个基于Mini容器的ControllerFactory</title><summary type="text">背景 随着Asp.net mvc的越来越流行，关于和Mvc整合的DI容器也非常的多，而Mini容器一致没有把整合的方案发布出来，以至于不时的收到有些网友询问这些事，于是便有了该文。[源代码从这里下载，Mini容器官方地址]解决方案 创建自定义工厂 public class NLiteControllerFactory : DefaultControllerFactory { private IServiceLocator ServiceLocator; public NLiteControllerFactory(IServiceLocator s...</summary><published>2011-12-19T04:13:00Z</published><updated>2011-12-19T04:13:00Z</updated><author><name>风云</name><uri>http://www.cnblogs.com/netcasewqs/</uri></author><link rel="alternate" href="http://www.cnblogs.com/netcasewqs/archive/2011/12/19/2293144.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/netcasewqs/archive/2011/12/19/2293144.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/netcasewqs/archive/2011/04/22/2024967.html</id><title type="text">DI 容器-Mini容器工作机制剖析(下篇）</title><summary type="text">上篇介绍了DI容器最基本功能，组件注册和组件创建和组件获取。这里将陆续把依赖注入进行详细介绍。 1. 看看组件工厂接口-IActivator的代码： /// &lt;summary&gt; /// 组件工厂 /// &lt;/summary&gt; public interface IActivator { /// &lt;summary&gt; /// 创建组件 /// &lt;/summary&gt; /// &lt;param name="ctx"&gt;创建上下文&lt;/param&gt; /// &lt;returns&gt;返回所创建的组件&lt;/retur</summary><published>2011-04-22T09:12:00Z</published><updated>2011-04-22T09:12:00Z</updated><author><name>风云</name><uri>http://www.cnblogs.com/netcasewqs/</uri></author><link rel="alternate" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/22/2024967.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/22/2024967.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/netcasewqs/archive/2011/04/21/2023787.html</id><title type="text">DI 容器-Mini容器工作机制剖析(上篇）</title><summary type="text">DI容器在DotNet 中已经不是什么稀罕东西了，如Castle，Unity，Ninject，StructureMap，Spring，MEF等等，这些DI容器都是老外设计的，国内开发的DI容器是少之又少，Mini容器便是少之又少中的一员。关于Mini容器的介绍,请参考去年7月份写的这篇文章：Mini容器介绍。 DI容器核心功能包含2大件，服务注册表和服务定位器。 服务注册表：掌管服务的配置或注册，服务注册成功后，DI容器会生成组件的元数据信息包含： 组件Id标志（服务定位器根据该标志获取组件实例），如果组件在注册时未提供标志，那么系统根据组件类型动态生成一个标志 组件类型 契约接口集合，一个.</summary><published>2011-04-21T09:45:00Z</published><updated>2011-04-21T09:45:00Z</updated><author><name>风云</name><uri>http://www.cnblogs.com/netcasewqs/</uri></author><link rel="alternate" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/21/2023787.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/21/2023787.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/netcasewqs/archive/2011/04/19/2020659.html</id><title type="text">Struct 创建性能大比拼（反射，泛型反射，泛型创建，缓存Emit）</title><summary type="text">上篇介绍了 Class 创建性能大比拼（反射，泛型反射，泛型创建，缓存Emit，非缓存Emit), 在这里做一个总结（执行10万次）直接创建Class对象最快 5ms缓存Emit 6ms (不包含Emit时间）泛型反射147ms泛型创建159ms(其实是编译器的语法糖，内部仍然调用泛型反射）反射340ms非缓存Emit 12786ms 经过上面的对比应该很清楚了Class创建原则： 直接创建-&gt;用缓存Emit-&gt;泛型反射-&gt;泛型创建-&gt;反射（反射大约比直接调用慢68倍左右），避免非缓存Emit 这篇就来一个Struct创建性能大比拼。因为Struct和Class一个是值</summary><published>2011-04-19T03:18:00Z</published><updated>2011-04-19T03:18:00Z</updated><author><name>风云</name><uri>http://www.cnblogs.com/netcasewqs/</uri></author><link rel="alternate" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/19/2020659.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/19/2020659.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/netcasewqs/archive/2011/04/18/2019999.html</id><title type="text">Class 创建性能大比拼（反射，泛型反射，泛型创建，缓存Emit，非缓存Emit）</title><summary type="text">一说到反射，很多人都想到了性能，更有甚者直接说“慎用反射，遗患无穷”，“用反射，感觉怎么像是退步啊～”，看到这种言论，直接把反射妖魔化了，如果这种言论长此以往，势必会对很多对反射初学者造成负面影响。反射是一把双刃剑，看你怎样使用了，下面我就用代码说话。class TestEntity { } 1. 手工创建TestEntity [TestInfo(Category = "Class.Constructor", Name = "Direct")] class DirectInvokeMode:IRunable { public void Run() { n</summary><published>2011-04-18T08:37:00Z</published><updated>2011-04-18T08:37:00Z</updated><author><name>风云</name><uri>http://www.cnblogs.com/netcasewqs/</uri></author><link rel="alternate" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/18/2019999.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/18/2019999.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/netcasewqs/archive/2011/04/13/2014684.html</id><title type="text">EmitMapper,AutoMapper,NLiteMapper和手工映射性能大比拼</title><summary type="text">在大比拼之前先讲一个小插曲，我这个人以前比较低调，做了很多好东西仅仅在公司内的朋友圈项目圈内分享，很少在博客园内进行分享，后来在dudu 老大的文章博客园现代化建设——AutoMapper有感便推荐一下OOMapper 组件,于是乎接连写了几篇入门性的介绍使用文章：开发人员必备工具：OOMapperOO Mapper 实践（上篇）OO Mapper 实践（下篇） 在园友Repository兄的NLiteMapper与EmitMapper性能简单比较中了解到NLiteMapper与EmitMapper的性能巨大差距，于是乎进行了两天的性能优化，同时总结了优化过程：一次性能优化最佳实践。在这里非.</summary><published>2011-04-13T04:49:00Z</published><updated>2011-04-13T04:49:00Z</updated><author><name>风云</name><uri>http://www.cnblogs.com/netcasewqs/</uri></author><link rel="alternate" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/13/2014684.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/13/2014684.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/netcasewqs/archive/2011/04/11/2012249.html</id><title type="text">一次性能优化最佳实践</title><summary type="text">上周五下班前，在Repository兄测试NLiteMapper和EmitMapper的文章中,发现了令我跌破眼镜的性能悬殊对比12283ms : 7ms。真不可思议，与是便把EmitMapper的源代码和OOMapper 的源代码一起下载下来，以Release模式的方式做一个公平对比。测试代码仍然沿用Repository兄的，代码如下：public class SimpleClassFrom { public long ID { get; set; } public string Name { get; set; } public int Age { get; set; } public .</summary><published>2011-04-11T03:28:00Z</published><updated>2011-04-11T03:28:00Z</updated><author><name>风云</name><uri>http://www.cnblogs.com/netcasewqs/</uri></author><link rel="alternate" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/11/2012249.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/11/2012249.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/netcasewqs/archive/2011/04/08/2009403.html</id><title type="text">OO Mapper 实践（下篇）</title><summary type="text">上篇介绍了OO Mapper 最核心的映射，简单类型映射，这篇将介绍的复合类型的映射。 1. Dictionary - &gt; Dictionary 字典类型分为：IDictionary,IDictioanry&lt;TKey,TValue&gt; public class SourceValue { public int Value { get; set; } } public class DestValue { public int Value { get; set; } } [Test] public void Example() { var sourceDict = new Dict</summary><published>2011-04-08T07:53:00Z</published><updated>2011-04-08T07:53:00Z</updated><author><name>风云</name><uri>http://www.cnblogs.com/netcasewqs/</uri></author><link rel="alternate" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/08/2009403.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/08/2009403.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/netcasewqs/archive/2011/04/08/2009278.html</id><title type="text">OO Mapper  实践（上篇）</title><summary type="text">上一篇介绍了OO Mapper的作用以及支持的功能。这一篇将以上一篇为提纲进行实践。 准备工作：下载NLite编译NLite 项目创建一个NUnit单元测试项目添加NLite.dll 引用添加 : using NLite; 实践： 1. Any -&gt; StringAssert.AreEqual("5", Mapper.Map&lt;int, string&gt;(5)); 2. primitive-&gt;Enum,Enum-&gt;primitive [TestFixture] public class EnumTests { public enum En1 : b</summary><published>2011-04-08T04:50:00Z</published><updated>2011-04-08T04:50:00Z</updated><author><name>风云</name><uri>http://www.cnblogs.com/netcasewqs/</uri></author><link rel="alternate" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/08/2009278.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/netcasewqs/archive/2011/04/08/2009278.html"/><content type="html"/></entry></feed>
