代码实现如下,注意几点: 1.Decorator中的Operation()方法是对被修饰对象ConcreteComponent中方法Operation()的封装 2.ConcreteDecorator中的Operation()方法是对其父类Operation()方法的封装,同时加入一些额外的新方法 3.ConcreteDecorator中的构造函数负责将修饰与被修饰对象链接在一起,如下图: ... Read More
posted @ 2007-10-02 21:21
包建强
Views(679)
Comments(0)
Diggs(0)
1.IHttpHandler接口 定义了实现一个HttpRequest的处理所必须实现的一些系统约定方法。 public interface IHttpHandler { //其他Request是否可以使用IHttpHandler bool IsReusable { get; } //处理HttpRequest ... Read More
posted @ 2007-10-02 14:40
包建强
Views(2202)
Comments(0)
Diggs(0)
1.ASP时代的HTTP请求处理过程 在IIS的应用程序映射中,IIS会将对asp和asa文件的请求转交给asp.dll这个ISAPI来处理 Inetinfo.exe进程,即www服务进程 解释型处理,每次请求都会重新解释一次,不适用于大流量请求 2.ASP.NET的HTTP请求处理过程 3.在HttpRuntime中请求处理过程 HttpRequest请求: 进入HttpRumtim... Read More
posted @ 2007-10-02 11:19
包建强
Views(6804)
Comments(9)
Diggs(2)
事实上,JIT编译器分成两种(经济编译器和普通编译器),而且它们生来也不是平等的。经济JIT编译器代表了运行一个.NET应用程序所需要的最少功能,它直接用对等的本机代码取代每一条MSIL指令,不进行任何优化从而也带来更少的系统负载。这也意味着它主要应用在内存等资源比较紧张的平台上。 另一方面,普通JIT编译器则是缺省的运行时配置,它会对其产生的代码进行即时优化。这样做无形中给予了... Read More
posted @ 2007-10-02 10:55
包建强
Views(2003)
Comments(2)
Diggs(0)
反射工厂是.NET独有的,因为它基于反射机制,可以用来简化工厂类。 public static object CreateByReflection(string strType) { Type t = Type.GetType(strType); ConstructorInfo ci = t.GetConstructo... Read More
posted @ 2007-10-02 00:22
包建强
Views(678)
Comments(0)
Diggs(0)
这个模式是对简单工厂的更高层次上的抽象,UML图如下: public abstract class AbstractFactory { public abstract AbstractProductA CreateProductA(); public abstract AbstractProductB CreateProductB(); ... Read More
posted @ 2007-10-02 00:21
包建强
Views(814)
Comments(1)
Diggs(0)
工厂方法模式,就是使一个类的实例化延迟到子类——惰性声明 UML图如下: public class Production { } public abstract class Creator { public abstract Production FactoryMathod(); } public class ConcreteCrea... Read More
posted @ 2007-10-02 00:20
包建强
Views(1372)
Comments(3)
Diggs(0)