• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • .NET設計模式:工廠方法模式(Factory Method)[5]

    發表于:2008-09-28來源:作者:點擊數: 標簽:MethodFactoryNetNET工廠
    關鍵字:設計模式 IHttpHandlerFactory工廠: 1public interface IHttpHandlerFactory 2{ 3 // Methods 4 IHttpHandler GetHandler(HttpContext context, string requestType, string url, string pathTranslated); 5 void ReleaseHandler(IHttpHandler hand
    關鍵字:設計模式
     IHttpHandlerFactory工廠:

    1public interface IHttpHandlerFactory
    2{
    3      // Methods
    4      IHttpHandler GetHandler(HttpContext context, string requestType, string url, string pathTranslated);
    5      void ReleaseHandler(IHttpHandler handler);
    6}
    7

        IHttpHandlerFactory.GetHandler是一個工廠方法模式的典型例子,在這個應用中,各個角色的設置如下:

        抽象工廠角色:IHttpHandlerFactory

        具體工廠角色:PageHandlerFactory

        抽象產品角色:IHttpHandler

        具體產品角色:ASP.SamplePage_aspx

        進一步去理解

        理解上面所說的之后,我們就可以去自定義工廠類來對特定的資源類型進行處理。第一步我們需要創建兩個類去分別實現IHttpHandlerFactory 和IHttpHandler這兩個接口。


     1public class HttpHandlerFactoryImpl:IHttpHandlerFactory {
     2  
     3   IHttpHandler IHttpHandlerFactory.GetHandler(
     4      HttpContext context, String requestType,

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>