锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久丫忘忧草产品,久久精品国产清自在天天线,久久er99热精品一区二区http://www.shnenglu.com/mzty/category/653.html<a href = "http://www.shnenglu.com/mzty/archive/2007/03/02/19109.html"><font size = 3 >{C++ 鍩虹}<font/></a> <a href = "http://www.shnenglu.com/mzty/archive/2007/08/13/29922.html"><font size = 3 >{C++ 楂樼駭}<font/></a> <a href = "http://www.shnenglu.com/mzty/archive/2007/04/16/22064.html"><font size = 3 >{C#鐣岄潰錛孋++鏍稿績綆楁硶}<font/></a> <a href = "http://www.shnenglu.com/mzty/archive/2007/03/04/19163.html"><font size = 3 >{璁捐妯″紡}<font/></a> <a href = " http://www.shnenglu.com/mzty/archive/2007/03/04/19167.html"><font size = 3 >{C#鍩虹}<font/></a> zh-cnFri, 20 Feb 2009 11:59:46 GMTFri, 20 Feb 2009 11:59:46 GMT60鏈崥瀹㈡墍鏈夌簿鍗庨殢絎旂儲寮?/title><link>http://www.shnenglu.com/mzty/archive/2008/01/17/41318.html</link><dc:creator>姊﹀湪澶╂動</dc:creator><author>姊﹀湪澶╂動</author><pubDate>Thu, 17 Jan 2008 02:14:00 GMT</pubDate><guid>http://www.shnenglu.com/mzty/archive/2008/01/17/41318.html</guid><wfw:comment>http://www.shnenglu.com/mzty/comments/41318.html</wfw:comment><comments>http://www.shnenglu.com/mzty/archive/2008/01/17/41318.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.shnenglu.com/mzty/comments/commentRss/41318.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/mzty/services/trackbacks/41318.html</trackback:ping><description><![CDATA[<p><br>鎬葷粨錛?a href="http://www.shnenglu.com/mzty/archive/2007/08/13/29922.html"><br><br>http://www.shnenglu.com/mzty/archive/2007/08/13/29922.html</a>  C++楂樼駭</p> <p><a href="http://www.shnenglu.com/mzty/archive/2007/03/02/19109.html">http://www.shnenglu.com/mzty/archive/2007/03/02/19109.html</a>  C++鍩虹</p> <p><a href="http://www.shnenglu.com/mzty/archive/2007/04/16/22064.html">http://www.shnenglu.com/mzty/archive/2007/04/16/22064.html</a>  C#鐣岄潰錛孋++鏍稿績綆楁硶</p> <p><a href="http://www.shnenglu.com/mzty/archive/2007/03/04/19163.html">http://www.shnenglu.com/mzty/archive/2007/03/04/19163.html</a>  璁捐妯″紡</p> <p><a href="http://www.shnenglu.com/mzty/archive/2007/03/29/20893.html">http://www.shnenglu.com/mzty/archive/2007/03/29/20893.html</a>  64bit錛孎W3.0闅忕瑪鍒嗙被 </p> <p><a href="http://www.shnenglu.com/mzty/archive/2007/03/29/20892.html">http://www.shnenglu.com/mzty/archive/2007/03/29/20892.html</a>  windows鑴氭湰鎶鏈?/p> <p><a href="http://www.shnenglu.com/mzty/archive/2007/03/04/19167.html">http://www.shnenglu.com/mzty/archive/2007/03/04/19167.html</a>  C#鍩虹</p><img src ="http://www.shnenglu.com/mzty/aggbug/41318.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/mzty/" target="_blank">姊﹀湪澶╂動</a> 2008-01-17 10:14 <a href="http://www.shnenglu.com/mzty/archive/2008/01/17/41318.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>絳栫暐妯″紡錛坧olicy錛?/title><link>http://www.shnenglu.com/mzty/archive/2007/05/24/24774.html</link><dc:creator>姊﹀湪澶╂動</dc:creator><author>姊﹀湪澶╂動</author><pubDate>Thu, 24 May 2007 11:42:00 GMT</pubDate><guid>http://www.shnenglu.com/mzty/archive/2007/05/24/24774.html</guid><wfw:comment>http://www.shnenglu.com/mzty/comments/24774.html</wfw:comment><comments>http://www.shnenglu.com/mzty/archive/2007/05/24/24774.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.shnenglu.com/mzty/comments/commentRss/24774.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/mzty/services/trackbacks/24774.html</trackback:ping><description><![CDATA[<br>涓錛岀瓥鐣ユā寮?br>   鍦ㄧ湅銆奀++璁捐鏂版濈淮銆嬬殑鏃跺欙紝鍙戠幇鍦ㄤ竴寮濮嬪氨澶х瘒騫呯殑浠嬬粛絳栫暐妯″紡錛坧olicy錛夛紝絳栫暐妯″紡涓嶅睘浜庣粡鍏歌璁℃ā寮忎腑鐨勪竴縐嶏紝浣嗘槸鍏跺疄鍦ㄦ垜浠棩甯哥殑寮鍙戜腑鏄繀涓嶅彲灝戠殑銆俻olicy,絳栫暐錛屾柟閽堬紝榪欓噷鐨勬剰鎬濇槸鎸囨妸澶嶆潅鍔熻兘鐨勭被灝介噺鐨勬媶鍒嗕負鍔熻兘鍗曚竴鐨勭畝鍗曠被鐨勭粍鍚堬紝綆鍗曠殑綾誨彧璐熻矗鍗曠函琛屼負鎴栫粨鏋勭殑鏌愪竴鏂歸潰銆傚鍔犵▼搴忓簱鐨勫脊鎬э紝鍙鐢ㄦэ紝鍙墿灞曟с俻olicy鏄竴涓櫄鎷熺殑姒傚康錛屼粬瀹氫箟浜嗘煇涓綾籧lass鐨勪竴浜涙帴鍙h鑼冿紝騫朵笉涓嶤++璇硶鐨勫叧閿瓧瀵瑰簲錛屽彧鏄竴涓娊璞$殑姒傚康銆?br><br>浜?nbsp; 瀹炰緥1<br><br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #008000">//</span><span style="COLOR: #008000">policy妯″紡鐨勫父瑙佷嬌鐢ㄥ疄渚媠martptr錛?/span><span style="COLOR: #008000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000"><</span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T,<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   template </span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> CheckingPolicy,<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   template </span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> ThreadingModel<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> SmartPtr<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   : </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> CheckingPolicy</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>   , </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> ThreadingModel</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">SmartPtr</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img id=Codehighlighter1_217_401_Open_Image onclick="this.style.display='none'; Codehighlighter1_217_401_Open_Text.style.display='none'; Codehighlighter1_217_401_Closed_Image.style.display='inline'; Codehighlighter1_217_401_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_217_401_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_217_401_Closed_Text.style.display='none'; Codehighlighter1_217_401_Open_Image.style.display='inline'; Codehighlighter1_217_401_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_217_401_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_217_401_Open_Text><span style="COLOR: #000000">{   <br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>   T</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">operator</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">()<br><img id=Codehighlighter1_244_374_Open_Image onclick="this.style.display='none'; Codehighlighter1_244_374_Open_Text.style.display='none'; Codehighlighter1_244_374_Closed_Image.style.display='inline'; Codehighlighter1_244_374_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_244_374_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_244_374_Closed_Text.style.display='none'; Codehighlighter1_244_374_Open_Image.style.display='inline'; Codehighlighter1_244_374_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>   </span><span id=Codehighlighter1_244_374_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_244_374_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      typename ThreadingModel</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">SmartPtr</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::Lock guard(</span><span style="COLOR: #000000">*</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">);<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      CheckingPolicy</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">::Check(pointee_);<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> pointee_;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>   }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">:<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>   T</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> pointee_;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">;</span></div> <br>涓?nbsp; 瀹炰緥浜岋紝姣斿璇達細鎴戜滑瀹氫箟涓涓猵olicy錛屼粬鏄竴涓甫鏈夊弬鏁癟鐨勪竴涓ā鐗堬紝浠栧繀欏繪湁涓涓狢reate鍑芥暟錛屼笖榪斿洖T綾誨瀷鎸囬拡銆傚浜庤繖涓畾涔夛紝鎴戜滑鍙互鏈変笉鍚岀殑瀹炵幇錛屼粠鑰屾弧瓚充笉鍚岀敤鎴風殑涓嶅悓鐨勯渶姹傘?br><br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">template </span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">struct</span><span style="COLOR: #000000"> OpNewCreator<br><img id=Codehighlighter1_39_93_Open_Image onclick="this.style.display='none'; Codehighlighter1_39_93_Open_Text.style.display='none'; Codehighlighter1_39_93_Closed_Image.style.display='inline'; Codehighlighter1_39_93_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_39_93_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_39_93_Closed_Text.style.display='none'; Codehighlighter1_39_93_Open_Image.style.display='inline'; Codehighlighter1_39_93_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_39_93_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_39_93_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>   </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> Create()<br><img id=Codehighlighter1_66_91_Open_Image onclick="this.style.display='none'; Codehighlighter1_66_91_Open_Text.style.display='none'; Codehighlighter1_66_91_Closed_Image.style.display='inline'; Codehighlighter1_66_91_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_66_91_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_66_91_Closed_Text.style.display='none'; Codehighlighter1_66_91_Open_Image.style.display='inline'; Codehighlighter1_66_91_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>   </span><span id=Codehighlighter1_66_91_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_66_91_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> T;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>   }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>template </span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">struct</span><span style="COLOR: #000000"> MallocCreator<br><img id=Codehighlighter1_137_264_Open_Image onclick="this.style.display='none'; Codehighlighter1_137_264_Open_Text.style.display='none'; Codehighlighter1_137_264_Closed_Image.style.display='inline'; Codehighlighter1_137_264_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_137_264_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_137_264_Closed_Text.style.display='none'; Codehighlighter1_137_264_Open_Image.style.display='inline'; Codehighlighter1_137_264_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_137_264_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_137_264_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>   </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> Create()<br><img id=Codehighlighter1_164_262_Open_Image onclick="this.style.display='none'; Codehighlighter1_164_262_Open_Text.style.display='none'; Codehighlighter1_164_262_Closed_Image.style.display='inline'; Codehighlighter1_164_262_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_164_262_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_164_262_Closed_Text.style.display='none'; Codehighlighter1_164_262_Open_Image.style.display='inline'; Codehighlighter1_164_262_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>   </span><span id=Codehighlighter1_164_262_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_164_262_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> buf </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> std::malloc(</span><span style="COLOR: #0000ff">sizeof</span><span style="COLOR: #000000">(T));<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> (</span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">buf) </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">(buf) T;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>   }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top>template </span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">struct</span><span style="COLOR: #000000"> PrototypeCreator<br><img id=Codehighlighter1_311_582_Open_Image onclick="this.style.display='none'; Codehighlighter1_311_582_Open_Text.style.display='none'; Codehighlighter1_311_582_Closed_Image.style.display='inline'; Codehighlighter1_311_582_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_311_582_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_311_582_Closed_Text.style.display='none'; Codehighlighter1_311_582_Open_Image.style.display='inline'; Codehighlighter1_311_582_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_311_582_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_311_582_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>   PrototypeCreator(T</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> pObj </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">)<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      :pPrototype_(pObj)<br><img id=Codehighlighter1_374_375_Open_Image onclick="this.style.display='none'; Codehighlighter1_374_375_Open_Text.style.display='none'; Codehighlighter1_374_375_Closed_Image.style.display='inline'; Codehighlighter1_374_375_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_374_375_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_374_375_Closed_Text.style.display='none'; Codehighlighter1_374_375_Open_Image.style.display='inline'; Codehighlighter1_374_375_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>   </span><span id=Codehighlighter1_374_375_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_374_375_Open_Text><span style="COLOR: #000000">{}</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>   T</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> Create()<br><img id=Codehighlighter1_395_453_Open_Image onclick="this.style.display='none'; Codehighlighter1_395_453_Open_Text.style.display='none'; Codehighlighter1_395_453_Closed_Image.style.display='inline'; Codehighlighter1_395_453_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_395_453_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_395_453_Closed_Text.style.display='none'; Codehighlighter1_395_453_Open_Image.style.display='inline'; Codehighlighter1_395_453_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>   </span><span id=Codehighlighter1_395_453_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_395_453_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> pPrototype_ </span><span style="COLOR: #000000">?</span><span style="COLOR: #000000"> pPrototype_</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">Clone() : </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>   }</span></span><span style="COLOR: #000000"><br><img id=Codehighlighter1_476_498_Open_Image onclick="this.style.display='none'; Codehighlighter1_476_498_Open_Text.style.display='none'; Codehighlighter1_476_498_Closed_Image.style.display='inline'; Codehighlighter1_476_498_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_476_498_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_476_498_Closed_Text.style.display='none'; Codehighlighter1_476_498_Open_Image.style.display='inline'; Codehighlighter1_476_498_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>   T</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> GetPrototype() </span><span id=Codehighlighter1_476_498_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_476_498_Open_Text><span style="COLOR: #000000">{ </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> pPrototype_; }</span></span><span style="COLOR: #000000"><br><img id=Codehighlighter1_530_552_Open_Image onclick="this.style.display='none'; Codehighlighter1_530_552_Open_Text.style.display='none'; Codehighlighter1_530_552_Closed_Image.style.display='inline'; Codehighlighter1_530_552_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_530_552_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_530_552_Closed_Text.style.display='none'; Codehighlighter1_530_552_Open_Image.style.display='inline'; Codehighlighter1_530_552_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>   </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> SetPrototype(T</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> pObj) </span><span id=Codehighlighter1_530_552_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_530_552_Open_Text><span style="COLOR: #000000">{ pPrototype_ </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> pObj; }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">:<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>   T</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> pPrototype_;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">test class</span><span style="COLOR: #008000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> Widget<br><img id=Codehighlighter1_612_614_Open_Image onclick="this.style.display='none'; Codehighlighter1_612_614_Open_Text.style.display='none'; Codehighlighter1_612_614_Closed_Image.style.display='inline'; Codehighlighter1_612_614_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_612_614_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_612_614_Closed_Text.style.display='none'; Codehighlighter1_612_614_Open_Image.style.display='inline'; Codehighlighter1_612_614_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_612_614_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_612_614_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">璋冪敤鏂規硶涓錛?/span><span style="COLOR: #008000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template </span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> CreationPolicy</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> WidgetManager : </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> CreationPolicy<br><img id=Codehighlighter1_703_708_Open_Image onclick="this.style.display='none'; Codehighlighter1_703_708_Open_Text.style.display='none'; Codehighlighter1_703_708_Closed_Image.style.display='inline'; Codehighlighter1_703_708_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_703_708_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_703_708_Closed_Text.style.display='none'; Codehighlighter1_703_708_Open_Image.style.display='inline'; Codehighlighter1_703_708_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_703_708_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_703_708_Open_Text><span style="COLOR: #000000">{   <br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> main()<br><img id=Codehighlighter1_723_787_Open_Image onclick="this.style.display='none'; Codehighlighter1_723_787_Open_Text.style.display='none'; Codehighlighter1_723_787_Closed_Image.style.display='inline'; Codehighlighter1_723_787_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_723_787_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_723_787_Closed_Text.style.display='none'; Codehighlighter1_723_787_Open_Image.style.display='inline'; Codehighlighter1_723_787_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_723_787_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_723_787_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>typedef WidgetManager</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000"> OpNewCreator</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">Widget</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> MyWidgetMgr;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">璋冪敤鏂規硶浜岋細鍥犱負涓鑸琈anager鏄壒瀹氫簬鏌愪竴綾葷殑class錛屾墍浠ュ湪Manager涓氨鎸囧畾瑕佸鐞嗙殑class綾誨瀷銆?/span><span style="COLOR: #008000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">template </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">template </span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> Created</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> CreationPolicy</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> WidgetManager : </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> CreationPolicy</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">Widget</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img id=Codehighlighter1_959_964_Open_Image onclick="this.style.display='none'; Codehighlighter1_959_964_Open_Text.style.display='none'; Codehighlighter1_959_964_Closed_Image.style.display='inline'; Codehighlighter1_959_964_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_959_964_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_959_964_Closed_Text.style.display='none'; Codehighlighter1_959_964_Open_Image.style.display='inline'; Codehighlighter1_959_964_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_959_964_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_959_964_Open_Text><span style="COLOR: #000000">{   <br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> main()<br><img id=Codehighlighter1_979_1051_Open_Image onclick="this.style.display='none'; Codehighlighter1_979_1051_Open_Text.style.display='none'; Codehighlighter1_979_1051_Closed_Image.style.display='inline'; Codehighlighter1_979_1051_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_979_1051_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_979_1051_Closed_Text.style.display='none'; Codehighlighter1_979_1051_Open_Image.style.display='inline'; Codehighlighter1_979_1051_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_979_1051_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_979_1051_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000"> Application code</span><span style="COLOR: #008000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">typedef WidgetManager</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">OpNewCreator</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> MyWidgetMgr;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span></div> <br>瀵逛簬涓婇潰涓涓瓥鐣ユ湁3涓笉鍚岀殑瀹炵幇錛屼粠鑰屽氨鍙互婊¤凍涓嶅悓鐨勫鎴風殑闇姹傘?br>浣嗘槸瀵逛簬涓婇潰鐨勪嬌鐢紝鎴戜滑榪樺彲浠ユ湁鏇村ソ鐨勪慨鏀癸細鍥犱負Policy鐨勫疄鐜癱lass涓鑸細琚戶鎵匡紝鎵浠ユ垜浠鑰冭檻浠栫殑鏋愭瀯錛屼竴鑸殑鎴戜滑浣挎瀽鏋勫嚱鏁皏irtual錛屼絾鏄繖閲屼細褰卞搷template鐨勯潤鎬佺紪璇戠壒鎬э紝褰卞搷鏁堢巼錛屾墍浠ユ垜浠嬌鐢╬rotected鎴杙rivate鐨勬瀽鏋勫嚱鏁幫紝鏃笉褰卞搷緇ф壙綾誨鍩虹被鐨勬瀽鏋勶紝涔熶笉褰卞搷浣跨敤銆?br>濡備慨鏀瑰涓嬶細<br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">template </span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">struct</span><span style="COLOR: #000000"> OpNewCreator<br><img id=Codehighlighter1_39_124_Open_Image onclick="this.style.display='none'; Codehighlighter1_39_124_Open_Text.style.display='none'; Codehighlighter1_39_124_Closed_Image.style.display='inline'; Codehighlighter1_39_124_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_39_124_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_39_124_Closed_Text.style.display='none'; Codehighlighter1_39_124_Open_Image.style.display='inline'; Codehighlighter1_39_124_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_39_124_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_39_124_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>   </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> T</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> Create()<br><img id=Codehighlighter1_66_89_Open_Image onclick="this.style.display='none'; Codehighlighter1_66_89_Open_Text.style.display='none'; Codehighlighter1_66_89_Closed_Image.style.display='inline'; Codehighlighter1_66_89_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_66_89_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_66_89_Closed_Text.style.display='none'; Codehighlighter1_66_89_Open_Image.style.display='inline'; Codehighlighter1_66_89_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>   </span><span id=Codehighlighter1_66_89_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_66_89_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>    </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> T;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>   }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #0000ff">protected</span><span style="COLOR: #000000">:<br><img id=Codehighlighter1_121_122_Open_Image onclick="this.style.display='none'; Codehighlighter1_121_122_Open_Text.style.display='none'; Codehighlighter1_121_122_Closed_Image.style.display='inline'; Codehighlighter1_121_122_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_121_122_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_121_122_Closed_Text.style.display='none'; Codehighlighter1_121_122_Open_Image.style.display='inline'; Codehighlighter1_121_122_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>   </span><span style="COLOR: #000000">~</span><span style="COLOR: #000000">OpNewCreator() </span><span id=Codehighlighter1_121_122_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_121_122_Open_Text><span style="COLOR: #000000">{}</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">;</span></div> <br>鎴戜滑榪樺彲浠ヤ慨鏀逛笂闈㈢殑manger錛屽疄鐜癱reator policy鐨剆witch錛?br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">template </span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">template </span><span style="COLOR: #000000"><</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> CreationPolicy</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> WidgetManager : </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> CreationPolicy</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">Widget</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br><img id=Codehighlighter1_101_291_Open_Image onclick="this.style.display='none'; Codehighlighter1_101_291_Open_Text.style.display='none'; Codehighlighter1_101_291_Closed_Image.style.display='inline'; Codehighlighter1_101_291_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_101_291_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_101_291_Closed_Text.style.display='none'; Codehighlighter1_101_291_Open_Image.style.display='inline'; Codehighlighter1_101_291_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_101_291_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_101_291_Open_Text><span style="COLOR: #000000">{ <br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>   </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> SwitchPrototype(Widget</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000"> pNewPrototype)<br><img id=Codehighlighter1_154_289_Open_Image onclick="this.style.display='none'; Codehighlighter1_154_289_Open_Text.style.display='none'; Codehighlighter1_154_289_Closed_Image.style.display='inline'; Codehighlighter1_154_289_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_154_289_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_154_289_Closed_Text.style.display='none'; Codehighlighter1_154_289_Open_Image.style.display='inline'; Codehighlighter1_154_289_Open_Text.style.display='inline';" src="http://www.shnenglu.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>   </span><span id=Codehighlighter1_154_289_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.shnenglu.com/Images/dot.gif"></span><span id=Codehighlighter1_154_289_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      CreationPolicy</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">Widget</span><span style="COLOR: #000000">>&</span><span style="COLOR: #000000"> myPolicy </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">*</span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">;<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      delete myPolicy.GetPrototype();<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/InBlock.gif" align=top>      myPolicy.SetPrototype(pNewPrototype);<br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>   }</span></span><span style="COLOR: #000000"><br><img src="http://www.shnenglu.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000">;</span></div> <br><br>鍥?policy 妯″紡瀵規垜浠垱寤哄彲澶嶇敤錛屽彲鎵╁睍鐨勫簱鐨勫紑鍙戞湁闈炲父閲嶈鐨勪綔鐢紝鏄疧O鐨勫熀鏈殑璁懼師鍒欏紡涔嬩竴銆?br><br> <img src ="http://www.shnenglu.com/mzty/aggbug/24774.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/mzty/" target="_blank">姊﹀湪澶╂動</a> 2007-05-24 19:42 <a href="http://www.shnenglu.com/mzty/archive/2007/05/24/24774.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>璁捐妯″紡闅忕瑪鍒嗙被http://www.shnenglu.com/mzty/archive/2007/03/04/19163.html姊﹀湪澶╂動姊﹀湪澶╂動Sun, 04 Mar 2007 03:31:00 GMThttp://www.shnenglu.com/mzty/archive/2007/03/04/19163.htmlhttp://www.shnenglu.com/mzty/comments/19163.htmlhttp://www.shnenglu.com/mzty/archive/2007/03/04/19163.html#Feedback2http://www.shnenglu.com/mzty/comments/commentRss/19163.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/19163.html璁捐妯″紡錛?/font>

璁捐妯″紡姒傚康


妯″紡瓚hВ

23縐嶇粡鍏歌璁℃ā寮?/font>

MFC涓庤璁℃ā寮?/font>

.net涓洿濂界殑浣跨敤璁捐妯″紡鐨凞LL(Commonly Used .NET Coding Patterns in CodeDom)

鍒涘緩鍨嬶細

妯″紡璁捐c#錛嶏紞鍒涘緩鍨嬶紞錛峟actory method

妯″紡璁捐c#錛嶏紞鍒涘緩鍨嬶紞錛岮bstractFactory

妯″紡璁捐c#錛嶏紞鍒涘緩鍨嬶紞錛岯uilder

妯″紡璁捐c#錛嶏紞鍒涘緩鍨嬶紞錛峆rototype

妯″紡璁捐c#錛嶏紞鍒涘緩鍨嬶紞錛峉ingleton

緇撴瀯鍨嬶細

妯″紡璁捐c#錛嶏紞緇撴瀯鍨嬶紞錛岮dapter

妯″紡璁捐c#錛嶏紞緇撴瀯鍨嬶紞錛岯ridge

妯″紡璁捐c#錛嶏紞緇撴瀯鍨嬶紞錛峜omposite

妯″紡璁捐c#錛嶏紞緇撴瀯鍨嬶紞錛峝ecorator

妯″紡璁捐c#錛嶏紞緇撴瀯鍨嬶紞錛峟acade

妯″紡璁捐c#錛嶏紞緇撴瀯鍨嬶紞錛峟lyweight

妯″紡璁捐c#錛嶏紞緇撴瀯鍨嬶紞錛峱roxy

琛屼負鍨嬶細

妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峣nterpreter

妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峵empletemethod

妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛岰hain of Responsibility

妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峜ommand

妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峣terator

妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峬ediator

妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峬enento

妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峯bserver

妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峴tate

妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峴trategy

妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峷isitor


鍏朵粬鐨勮璁℃ā寮忥細
絳栫暐妯″紡錛坧olicy錛?/font>


]]>
MFC涓庤璁℃ā寮?/title><link>http://www.shnenglu.com/mzty/archive/2006/05/25/7640.html</link><dc:creator>姊﹀湪澶╂動</dc:creator><author>姊﹀湪澶╂動</author><pubDate>Thu, 25 May 2006 05:39:00 GMT</pubDate><guid>http://www.shnenglu.com/mzty/archive/2006/05/25/7640.html</guid><wfw:comment>http://www.shnenglu.com/mzty/comments/7640.html</wfw:comment><comments>http://www.shnenglu.com/mzty/archive/2006/05/25/7640.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/mzty/comments/commentRss/7640.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/mzty/services/trackbacks/7640.html</trackback:ping><description><![CDATA[ <p>This main topic of this article is to show how patterns are used in MFC. We will be seeing the usage of three patterns in MFC library.</p> <h3>Creational : Singleton Pattern</h3> <p>First step in any MFC application is the creation of application object (object of class derived from <code>CWinApp</code>). There should be only one application object in an instance of MFC application. <code>CWinApp</code> is designed to make sure that only application object is present in a given instance. <code>CWinApp</code> and its descendants are called Singleton Classes. <i>A class (<code>CWinApp</code> or its descendant) that assures a maximum of ONE object of its type at a given time and provides a global access point (<code>AfxGetApp()</code> method) to this object is a Singleton class.</i></p> <p>As this principle is applied over and over again to solve recurring object "creational" problems, this becomes a pattern. Singleton Pattern ensures that a class only has one instance and provides a global access point it. The article <a >Creating Singleton Objects using Visual C++</a> talks about different approaches for implementing Singletons.</p> <h3>Structural : Bridge Pattern</h3> <p>Bridge Pattern is all about decoupling an abstraction (interface) from its implementation so that the two can vary independently. In MFC, the process of storing/retrieving an object to/from a persistence mechanism (like a file) is called Serialization. MFC uses the Bridge Pattern to implement Serialization. <code>CArchive</code> and <code>CFile</code> classes implement object Serialization. CArchive class provides the interface for writing/reading an object to/from a persistence mechanism whereas the <code>CFile</code> and its sub classes provides implementation for different persistence mechanisms such as memory, disk file, sockets etc.</p> <p>A <code>CArchive</code> object is configured with an object of class <code>CFile</code> (or a derived class) during its construction, from which it obtains the necessary information for serialization, including the filename and type of the requested operation (a read or write). Client performing the Serialization operation can use CArchive object without regarding the persistence mechanism implemented by <code>CFile</code> classes.</p> <p>The article <a >Bridge Pattern - Bridging the gap between Interface and Implementation</a> talks about Bridge pattern in detail.</p> <h3>Behavioral : Observer Pattern</h3> <p>The Observer Pattern is intended to <i>"Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically"</i>. An object that is subjected to change is called a <b>Subject</b> and an object that depends on the Subject's state is called an <b>Observer</b>.</p> <p>MFC uses a Document/View variant of the Observer Pattern. MFC's famous Document/View architecture uses this variant. A document contains the data object and acts as a Subject. A view is a window object through which the user updates the document and it acts as an Observer. A document can have multiple views. Whenever the data in the document is changed by one of the views, it updates the document by calling <code>UpdateAllViews</code> method, with optional hint about the modification. To inform about the change to other views, the document object calls <code>OnUpdate</code> method for each view attached to it (except the view that called <code>UpdateAllViews</code>). Derived view classes can override the OnUpdate method and update themselves by querying the data from the document.</p> <p>The article <a >Applying Observer Pattern in C++ Applications</a> talks about Observer pattern in detail.</p> <h2>Summary</h2> <p>Design Pattern provides a common language for designers and helps them to decompose systems into a set of cooperating classes and objects. They provide proven design solution to recurring problems. In this article, I have introduced the design pattern and how MFC is using some of the patterns in its design. We can easily find more and more patterns when we dig into MFC and its classes.</p> <!-- Article Ends --> <img src ="http://www.shnenglu.com/mzty/aggbug/7640.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/mzty/" target="_blank">姊﹀湪澶╂動</a> 2006-05-25 13:39 <a href="http://www.shnenglu.com/mzty/archive/2006/05/25/7640.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鎺ュ彛妯″紡 -- 鎺ュ彛涓負浠涔堜笉鑳藉寘鍚玠elegatehttp://www.shnenglu.com/mzty/archive/2006/05/18/7352.html姊﹀湪澶╂動姊﹀湪澶╂動Thu, 18 May 2006 07:21:00 GMThttp://www.shnenglu.com/mzty/archive/2006/05/18/7352.htmlhttp://www.shnenglu.com/mzty/comments/7352.htmlhttp://www.shnenglu.com/mzty/archive/2006/05/18/7352.html#Feedback0http://www.shnenglu.com/mzty/comments/commentRss/7352.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/7352.html
聽鎺ュ彛鍙互鍖呭惈function, property, index, event ,浣嗘槸涓嶈兘鍖呭惈 delegate:
聽:鍥犱負涓涓帴鍙e0鏄庤鑼冧簡鎴愬憳,涓嶆槸綾誨瀷.聽delegate寮曞叆涓涓柊鐨勭被鍨?鑰宔vent寮曞叆鐨勬槸涓涓柊鐨勬垚鍛?

]]>
.net涓洿濂界殑浣跨敤璁捐妯″紡鐨凞LL(Commonly Used .NET Coding Patterns in CodeDom)(杞?http://www.shnenglu.com/mzty/archive/2006/05/09/6805.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 09 May 2006 01:46:00 GMThttp://www.shnenglu.com/mzty/archive/2006/05/09/6805.htmlhttp://www.shnenglu.com/mzty/comments/6805.htmlhttp://www.shnenglu.com/mzty/archive/2006/05/09/6805.html#Feedback0http://www.shnenglu.com/mzty/comments/commentRss/6805.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/6805.html Download binary - 263 Kb
  • Download source - 275 Kb

    Table of contents

    聽聽 鍘熸枃鍦板潃:http://www.codeproject.com/csharp/codedompatterns.asp



  • ]]>
    妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峷isitorhttp://www.shnenglu.com/mzty/archive/2006/01/03/2402.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 08:18:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2402.htmlhttp://www.shnenglu.com/mzty/comments/2402.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2402.html#Feedback2http://www.shnenglu.com/mzty/comments/commentRss/2402.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2402.html 鍚嶇О Visitor 緇撴瀯 r_visitor.bmp 鎰忓浘 琛ㄧず涓涓綔鐢ㄤ簬鏌愬璞$粨鏋勪腑鐨勫悇鍏冪礌鐨勬搷浣溿傚畠浣夸綘鍙互鍦ㄤ笉鏀瑰彉鍚勫厓绱犵殑綾葷殑鍓嶆彁涓嬪畾涔変綔鐢ㄤ簬榪欎簺鍏冪礌鐨勬柊鎿嶄綔銆?/td> 閫傜敤鎬?/td>
    • 涓涓璞$粨鏋勫寘鍚緢澶氱被瀵硅薄錛屽畠浠湁涓嶅悓鐨勬帴鍙o紝鑰屼綘鎯沖榪欎簺瀵硅薄瀹炴柦涓浜涗緷璧栦簬鍏跺叿浣撶被鐨勬搷浣溿?
    • 闇瑕佸涓涓璞$粨鏋勪腑鐨勫璞¤繘琛屽緢澶氫笉鍚岀殑騫朵笖涓嶇浉鍏崇殑鎿嶄綔錛岃屼綘鎯抽伩鍏嶈榪欎簺鎿嶄綔鈥滄薄鏌撯濊繖浜涘璞$殑綾匯俈i s i t o r 浣垮緱浣犲彲浠ュ皢鐩稿叧鐨勬搷浣滈泦涓搗鏉ュ畾涔夊湪涓涓被涓傚綋璇ュ璞$粨鏋勮寰堝搴旂敤鍏變韓鏃訛紝鐢╒i s i t o r 妯″紡璁╂瘡涓簲鐢ㄤ粎鍖呭惈闇瑕佺敤鍒扮殑鎿嶄綔銆?
    • 瀹氫箟瀵硅薄緇撴瀯鐨勭被寰堝皯鏀瑰彉錛屼絾緇忓父闇瑕佸湪姝ょ粨鏋勪笂瀹氫箟鏂扮殑鎿嶄綔銆傛敼鍙樺璞$粨鏋勭被闇瑕侀噸瀹氫箟瀵規墍鏈夎闂呯殑鎺ュ彛錛岃繖鍙兘闇瑕佸緢澶х殑浠d環銆傚鏋滃璞$粨鏋勭被緇忓父鏀瑰彉錛岄偅涔堝彲鑳借繕鏄湪榪欎簺綾諱腑瀹氫箟榪欎簺鎿嶄綔杈冨ソ銆?


    // Visitor pattern -- Structural example

    using System;
    using System.Collections;

    namespace DoFactory.GangOfFour.Visitor.Structural
    {
    聽聽
    聽聽// MainApp test application

    聽聽class MainApp
    聽聽{
    聽聽聽聽staticvoid Main()
    聽聽聽聽{
    聽聽聽聽聽聽// Setup structure
    聽聽聽聽聽聽ObjectStructure o = new ObjectStructure();
    聽聽聽聽聽聽o.Attach(new ConcreteElementA());
    聽聽聽聽聽聽o.Attach(new ConcreteElementB());

    聽聽聽聽聽聽// Create visitor objects
    聽聽聽聽聽聽ConcreteVisitor1 v1 = new ConcreteVisitor1();
    聽聽聽聽聽聽ConcreteVisitor2 v2 = new ConcreteVisitor2();

    聽聽聽聽聽聽// Structure accepting visitors
    聽聽聽聽聽聽o.Accept(v1);
    聽聽聽聽聽聽o.Accept(v2);

    聽聽聽聽聽聽// Wait for user
    聽聽聽聽聽聽Console.Read();
    聽聽聽聽}
    聽聽}

    聽聽// "Visitor"

    聽聽abstractclass Visitor
    聽聽{
    聽聽聽聽publicabstractvoid VisitConcreteElementA(
    聽聽聽聽聽聽ConcreteElementA concreteElementA);
    聽聽聽聽publicabstractvoid VisitConcreteElementB(
    聽聽聽聽聽聽ConcreteElementB concreteElementB);
    聽聽}

    聽聽// "ConcreteVisitor1"

    聽聽class ConcreteVisitor1 : Visitor
    聽聽{
    聽聽聽聽publicoverridevoid VisitConcreteElementA(
    聽聽聽聽聽聽ConcreteElementA concreteElementA)
    聽聽聽聽{
    聽聽聽聽聽聽Console.WriteLine("{0} visited by {1}",
    聽聽聽聽聽聽聽聽concreteElementA.GetType().Name, this.GetType().Name);
    聽聽聽聽}

    聽聽聽聽publicoverridevoid VisitConcreteElementB(
    聽聽聽聽聽聽ConcreteElementB concreteElementB)
    聽聽聽聽{
    聽聽聽聽聽聽Console.WriteLine("{0} visited by {1}",
    聽聽聽聽聽聽聽聽concreteElementB.GetType().Name, this.GetType().Name);
    聽聽聽聽}
    聽聽}

    聽聽// "ConcreteVisitor2"

    聽聽class ConcreteVisitor2 : Visitor
    聽聽{
    聽聽聽聽publicoverridevoid VisitConcreteElementA(
    聽聽聽聽聽聽ConcreteElementA concreteElementA)
    聽聽聽聽{
    聽聽聽聽聽聽Console.WriteLine("{0} visited by {1}",
    聽聽聽聽聽聽聽聽concreteElementA.GetType().Name, this.GetType().Name);
    聽聽聽聽}

    聽聽聽聽publicoverridevoid VisitConcreteElementB(
    聽聽聽聽聽聽ConcreteElementB concreteElementB)
    聽聽聽聽{
    聽聽聽聽聽聽Console.WriteLine("{0} visited by {1}",
    聽聽聽聽聽聽聽聽concreteElementB.GetType().Name, this.GetType().Name);
    聽聽聽聽}
    聽聽}

    聽聽// "Element"

    聽聽abstractclass Element
    聽聽{
    聽聽聽聽publicabstractvoid Accept(Visitor visitor);
    聽聽}

    聽聽// "ConcreteElementA"

    聽聽class ConcreteElementA : Element
    聽聽{
    聽聽聽聽publicoverridevoid Accept(Visitor visitor)
    聽聽聽聽{
    聽聽聽聽聽聽visitor.VisitConcreteElementA(this);
    聽聽聽聽}

    聽聽聽聽publicvoid OperationA()
    聽聽聽聽{
    聽聽聽聽}
    聽聽}

    聽聽// "ConcreteElementB"

    聽聽class ConcreteElementB : Element
    聽聽{
    聽聽聽聽publicoverridevoid Accept(Visitor visitor)
    聽聽聽聽{
    聽聽聽聽聽聽visitor.VisitConcreteElementB(this);
    聽聽聽聽}

    聽聽聽聽publicvoid OperationB()
    聽聽聽聽{
    聽聽聽聽}
    聽聽}

    聽聽// "ObjectStructure"

    聽聽class ObjectStructure
    聽聽{
    聽聽聽聽private ArrayList elements = new ArrayList();

    聽聽聽聽publicvoid Attach(Element element)
    聽聽聽聽{
    聽聽聽聽聽聽elements.Add(element);
    聽聽聽聽}

    聽聽聽聽publicvoid Detach(Element element)
    聽聽聽聽{
    聽聽聽聽聽聽elements.Remove(element);
    聽聽聽聽}

    聽聽聽聽publicvoid Accept(Visitor visitor)
    聽聽聽聽{
    聽聽聽聽聽聽foreach (Element e in elements)
    聽聽聽聽聽聽{
    聽聽聽聽聽聽聽聽e.Accept(visitor);
    聽聽聽聽聽聽}
    聽聽聽聽}
    聽聽}
    }
    Output
    ConcreteElementA visited by ConcreteVisitor1
    ConcreteElementB visited by ConcreteVisitor1
    ConcreteElementA visited by ConcreteVisitor2
    ConcreteElementB visited by ConcreteVisitor2


    ]]>
    妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峴trategyhttp://www.shnenglu.com/mzty/archive/2006/01/03/2401.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 08:17:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2401.htmlhttp://www.shnenglu.com/mzty/comments/2401.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2401.html#Feedback0http://www.shnenglu.com/mzty/comments/commentRss/2401.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2401.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峴tate http://www.shnenglu.com/mzty/archive/2006/01/03/2400.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 08:15:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2400.htmlhttp://www.shnenglu.com/mzty/comments/2400.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2400.html#Feedback2http://www.shnenglu.com/mzty/comments/commentRss/2400.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2400.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峯bserverhttp://www.shnenglu.com/mzty/archive/2006/01/03/2399.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 08:13:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2399.htmlhttp://www.shnenglu.com/mzty/comments/2399.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2399.html#Feedback0http://www.shnenglu.com/mzty/comments/commentRss/2399.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2399.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峬enentohttp://www.shnenglu.com/mzty/archive/2006/01/03/2398.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 08:12:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2398.htmlhttp://www.shnenglu.com/mzty/comments/2398.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2398.html#Feedback1http://www.shnenglu.com/mzty/comments/commentRss/2398.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2398.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峬ediatorhttp://www.shnenglu.com/mzty/archive/2006/01/03/2397.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 08:10:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2397.htmlhttp://www.shnenglu.com/mzty/comments/2397.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2397.html#Feedback0http://www.shnenglu.com/mzty/comments/commentRss/2397.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2397.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峣teratorhttp://www.shnenglu.com/mzty/archive/2006/01/03/2396.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 08:08:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2396.htmlhttp://www.shnenglu.com/mzty/comments/2396.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2396.html#Feedback1http://www.shnenglu.com/mzty/comments/commentRss/2396.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2396.html 鍚嶇О Iterator 緇撴瀯 o_iterator.bmp 鎰忓浘 鎻愪緵涓縐嶆柟娉曢『搴忚闂竴涓仛鍚堝璞′腑鍚勪釜鍏冪礌, 鑰屽張涓嶉渶鏆撮湶璇ュ璞$殑鍐呴儴琛ㄧず銆?/TD> 閫傜敤鎬?/TD>
    • 璁塊棶涓涓仛鍚堝璞$殑鍐呭鑰屾棤闇鏆撮湶瀹冪殑鍐呴儴琛ㄧず銆?
    • 鏀寔瀵硅仛鍚堝璞$殑澶氱閬嶅巻銆?
    • 涓洪亶鍘嗕笉鍚岀殑鑱氬悎緇撴瀯鎻愪緵涓涓粺涓鐨勬帴鍙?鍗? 鏀寔澶氭佽凱浠?銆?


    namespace Iterator_DesignPattern
    {
        
    using System;
        
    using System.Collections;

        
    class Node 
        
    {
            
    private string name;
            
    public string Name 
            
    {
                
    get 
                
    {
                    
    return name;    
                }

            }

            
    public Node(string s)
            
    {
                name 
    = s;
            }

        }

        
        
    class NodeCollection 
        
    {
            
    private ArrayList list = new ArrayList();
            
    private int nodeMax = 0;
            
            
    // left as a student exercise - implement collection
            
    // functions to remove and edit entries also
            public void AddNode(Node n)
            
    {
                list.Add(n); 
                nodeMax
    ++;            
            }
            
            
    public Node GetNode(int i)
            
    {
                
    return ((Node) list[i]);
            }


            
    public int NodeMax 
            
    {            
                
    get 
                
    {
                    
    return nodeMax;
                }

            }

        }


        
    /*
         * The iterator needs to understand how to traverse the collection 
         * It can do that as way it pleases - forward, reverse, depth-first, 
         
    */

        
    abstract class Iterator 
        
    {
            
    abstract public Node Next();        
        }


        
    class ReverseIterator : Iterator
        
    {
            
    private NodeCollection nodeCollection;
            
    private int currentIndex;

            
    public ReverseIterator (NodeCollection c)
            
    {
                nodeCollection 
    = c;            
                currentIndex 
    = c.NodeMax -1// array index starts at 0!
            }


            
    // note: as the code stands, if the collection changes,
            
    // the iterator needs to be restarted 
            override public Node Next()
            
    {
                
    if (currentIndex == -1)
                    
    return null;
                
    else 
                    
    return(nodeCollection.GetNode(currentIndex--));
            }

        }

        
        
    /// <summary>
        
    ///    Summary description for Client.
        
    /// </summary>

        public class Client
        
    {
            
    public static int Main(string[] args)
            
    {   
                NodeCollection c 
    = new NodeCollection();
                c.AddNode(
    new Node("first"));
                c.AddNode(
    new Node("second"));
                c.AddNode(
    new Node("third"));

                
    // now use iterator to traverse this
                ReverseIterator i = new ReverseIterator(c);

                
    // the code below will work with any iterator type
                Node n;
                
    do 
                
    {
                    n 
    = i.Next();
                    
    if (n != null
                        Console.WriteLine(
    "{0}", n.Name);
                }
     while (n != null);
                    
                
    return 0;
            }

        }

    }



    ]]>
    妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峜ommandhttp://www.shnenglu.com/mzty/archive/2006/01/03/2395.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 08:07:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2395.htmlhttp://www.shnenglu.com/mzty/comments/2395.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2395.html#Feedback1http://www.shnenglu.com/mzty/comments/commentRss/2395.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2395.html 鍚嶇О Command 緇撴瀯 o_command.bmp 鎰忓浘 灝嗕竴涓姹傚皝瑁呬負涓涓璞★紝浠庤屼嬌浣犲彲鐢ㄤ笉鍚岀殑璇鋒眰瀵瑰鎴瘋繘琛屽弬鏁板寲錛涘璇鋒眰鎺掗槦鎴栬褰曡姹傛棩蹇楋紝浠ュ強鏀寔鍙挙娑堢殑鎿嶄綔銆?/TD> 閫傜敤鎬?/TD>
    • 鎶借薄鍑哄緟鎵ц鐨勫姩浣滀互鍙傛暟鍖栨煇瀵硅薄錛屼綘鍙敤榪囩▼璇█涓殑鍥炶皟錛坈 a l l b a c k 錛夊嚱鏁拌〃杈捐繖縐嶅弬鏁板寲鏈哄埗銆傛墍璋撳洖璋冨嚱鏁版槸鎸囧嚱鏁板厛鍦ㄦ煇澶勬敞鍐岋紝鑰屽畠灝嗗湪紼嶅悗鏌愪釜闇瑕佺殑鏃跺欒璋冪敤銆侰 o m m a n d 妯″紡鏄洖璋冩満鍒剁殑涓涓潰鍚戝璞$殑鏇夸唬鍝併?
    • 鍦ㄤ笉鍚岀殑鏃跺埢鎸囧畾銆佹帓鍒楀拰鎵ц璇鋒眰銆備竴涓狢 o m m a n d 瀵硅薄鍙互鏈変竴涓笌鍒濆璇鋒眰鏃犲叧鐨勭敓瀛樻湡銆傚鏋滀竴涓姹傜殑鎺ユ敹鑰呭彲鐢ㄤ竴縐嶄笌鍦板潃絀洪棿鏃犲叧鐨勬柟寮忚〃杈撅紝閭d箞灝卞彲灝嗚礋璐h璇鋒眰鐨勫懡浠ゅ璞′紶閫佺粰鍙︿竴涓笉鍚岀殑榪涚▼騫跺湪閭e効瀹炵幇璇ヨ姹傘?
    • 鏀寔鍙栨秷鎿嶄綔銆侰 o m m a n d 鐨凟 x c u t e 鎿嶄綔鍙湪瀹炴柦鎿嶄綔鍓嶅皢鐘舵佸瓨鍌ㄨ搗鏉ワ紝鍦ㄥ彇娑堟搷浣滄椂榪欎釜鐘舵佺敤鏉ユ秷闄よ鎿嶄綔鐨勫獎鍝嶃侰 o m m a n d 鎺ュ彛蹇呴』娣誨姞涓涓猆 n e x e c u t e 鎿嶄綔錛岃鎿嶄綔鍙栨秷涓婁竴嬈 x e c u t e 璋冪敤鐨勬晥鏋溿傛墽琛岀殑鍛戒護琚瓨鍌ㄥ湪涓涓巻鍙插垪琛ㄤ腑銆傚彲閫氳繃鍚戝悗鍜屽悜鍓嶉亶鍘嗚繖涓鍒楄〃騫跺垎鍒皟鐢║ n e x e c u t e 鍜孍 x e c u t e 鏉ュ疄鐜伴噸鏁頒笉闄愮殑鈥滃彇娑堚濆拰鈥滈噸鍋氣濄?
    • 鏀寔淇敼鏃ュ織錛岃繖鏍峰綋緋葷粺宕╂簝鏃訛紝榪欎簺淇敼鍙互琚噸鍋氫竴閬嶃傚湪C o m m a n d 鎺ュ彛涓坊鍔犺杞芥搷浣滃拰瀛樺偍鎿嶄綔錛屽彲浠ョ敤鏉ヤ繚鎸佸彉鍔ㄧ殑涓涓竴鑷寸殑淇敼鏃ュ織銆備粠宕╂簝涓仮澶嶇殑榪囩▼鍖呮嫭浠庣鐩樹腑閲嶆柊璇誨叆璁板綍涓嬫潵鐨勫懡浠ゅ茍鐢‥ x e c u t e 鎿嶄綔閲嶆柊鎵ц瀹冧滑銆?
    • 鐢ㄦ瀯寤哄湪鍘熻鎿嶄綔涓婄殑楂樺眰鎿嶄綔鏋勯犱竴涓郴緇熴傝繖鏍蜂竴縐嶇粨鏋勫湪鏀寔浜嬪姟( t r a n s a c t i o n )鐨勪俊鎭郴緇熶腑寰堝父瑙併備竴涓簨鍔″皝瑁呬簡瀵規暟鎹殑涓緇勫彉鍔ㄣ侰 o m m a n d 妯″紡鎻愪緵浜嗗浜嬪姟榪涜寤烘ā鐨勬柟娉曘侰 o m m a n d 鏈変竴涓叕鍏辯殑鎺ュ彛錛屼嬌寰椾綘鍙互鐢ㄥ悓涓縐嶆柟寮忚皟鐢ㄦ墍鏈夌殑浜嬪姟銆傚悓鏃朵嬌鐢ㄨ妯″紡涔熸槗浜庢坊鍔犳柊浜嬪姟浠ユ墿灞曠郴緇熴?

    Code Example
    namespace Command_DesignPattern
    {
        
    using System;

        
    abstract class Command 
        
    {
            
    abstract public void Execute();
            
    protected Receiver r;
            
    public Receiver R
            
    {
                
    set 
                
    {
                    r 
    = value; 
                }

            }

        }


        
    class ConcreteCommand : Command
        
    {
            
    override public void Execute()
            
    {
                Console.WriteLine(
    "Command executed");
                r.InformAboutCommand();
            }

        }


        
    class Receiver 
        
    {
            
    public void InformAboutCommand()
            
    {
                Console.WriteLine(
    "Receiver informed about command");
            }

            
        }


        
    class Invoker 
        
    {
            
    private Command command;
            
    public void StoreCommand(Command c)
            
    {
                command 
    = c;
            }

            
    public void ExecuteCommand()
            
    {
                command.Execute();
            }
            
        }


        
    /// <summary>
        
    ///    Summary description for Client.
        
    /// </summary>

        public class Client
        
    {
            
    public static int Main(string[] args)
            
    {        
                
    // Set up everything
                Command c = new ConcreteCommand();
                Receiver r 
    = new Receiver();
                c.R 
    = r;
                Invoker i 
    = new Invoker();
                i.StoreCommand(c);

                
    // now let application run

                
    // the invoker is how the command is exposed for the end-user 
                
    // (or a client) initiates the command, 
                
    // (e.g. toolbar button, menu item)

                i.ExecuteCommand();

                
    return 0;
            }

        }

    }



    ]]>
    妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛岰hain of Responsibilityhttp://www.shnenglu.com/mzty/archive/2006/01/03/2394.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 08:06:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2394.htmlhttp://www.shnenglu.com/mzty/comments/2394.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2394.html#Feedback1http://www.shnenglu.com/mzty/comments/commentRss/2394.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2394.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峵empletemethodhttp://www.shnenglu.com/mzty/archive/2006/01/03/2393.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 08:04:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2393.htmlhttp://www.shnenglu.com/mzty/comments/2393.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2393.html#Feedback0http://www.shnenglu.com/mzty/comments/commentRss/2393.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2393.html 鍚嶇О Template Method 緇撴瀯 o_templetemethod.bmp 鎰忓浘 瀹氫箟涓涓搷浣滀腑鐨勭畻娉曠殑楠ㄦ灦錛岃屽皢涓浜涙楠ゅ歡榪熷埌瀛愮被涓俆e m p l a t e M e t h o d 浣垮緱瀛愮被鍙互涓嶆敼鍙樹竴涓畻娉曠殑緇撴瀯鍗沖彲閲嶅畾涔夎綆楁硶鐨勬煇浜涚壒瀹氭楠ゃ?/td> 閫傜敤鎬?/td>
    • 涓嬈℃у疄鐜頒竴涓畻娉曠殑涓嶅彉鐨勯儴鍒嗭紝騫跺皢鍙彉鐨勮涓虹暀緇欏瓙綾繪潵瀹炵幇銆?
    • 鍚勫瓙綾諱腑鍏叡鐨勮涓哄簲琚彁鍙栧嚭鏉ュ茍闆嗕腑鍒頒竴涓叕鍏辯埗綾諱腑浠ラ伩鍏嶄唬鐮侀噸澶嶃傝繖鏄疧 p d y k e 鍜孞 o h n s o n 鎵鎻忚堪榪囩殑鈥滈噸鍒嗚В浠ヤ竴鑸寲鈥濈殑涓涓緢濂界殑渚嬪瓙[ O J 9 3 ]銆傞鍏堣瘑鍒幇鏈変唬鐮佷腑鐨勪笉鍚屼箣澶勶紝騫朵笖灝嗕笉鍚屼箣澶勫垎紱諱負鏂扮殑鎿嶄綔銆傛渶鍚庯紝鐢ㄤ竴涓皟鐢ㄨ繖浜涙柊鐨勬搷浣滅殑妯℃澘鏂規硶鏉ユ浛鎹㈣繖浜涗笉鍚岀殑浠g爜銆?
    • 鎺у埗瀛愮被鎵╁睍銆傛ā鏉挎柟娉曞彧鍦ㄧ壒瀹氱偣璋冪敤鈥渉 o o k 鈥濇搷浣滐紙鍙傝鏁堟灉涓鑺傦級錛岃繖鏍峰氨鍙厑璁稿湪榪欎簺鐐硅繘琛屾墿灞曘?

    Code Example
    namespace聽TemplateMethod_DesignPattern
    {
    聽聽聽聽
    using聽System;

    聽聽聽聽
    class聽Algorithm聽
    聽聽聽聽
    {
    聽聽聽聽聽聽聽聽
    publicvoid聽DoAlgorithm()聽
    聽聽聽聽聽聽聽聽
    {
    聽聽聽聽聽聽聽聽聽聽聽聽Console.WriteLine(
    "In聽DoAlgorithm");
    聽聽聽聽聽聽聽聽聽聽聽聽
    聽聽聽聽聽聽聽聽聽聽聽聽
    //聽do聽some聽part聽of聽the聽algorithm聽here
    聽聽聽聽聽聽聽聽聽聽聽聽
    聽聽聽聽聽聽聽聽聽聽聽聽
    //聽step1聽goes聽here
    聽聽聽聽聽聽聽聽聽聽聽聽Console.WriteLine("In聽Algorithm聽-聽DoAlgoStep1");聽聽聽聽聽聽聽聽聽聽聽聽
    聽聽聽聽聽聽聽聽聽聽聽聽
    //聽.聽.聽.聽

    聽聽聽聽聽聽聽聽聽聽聽聽
    //聽step聽2聽goes聽here
    聽聽聽聽聽聽聽聽聽聽聽聽Console.WriteLine("In聽Algorithm聽-聽DoAlgoStep2");聽聽聽聽聽聽聽聽聽聽聽聽
    聽聽聽聽聽聽聽聽聽聽聽聽
    //聽.聽.聽.聽

    聽聽聽聽聽聽聽聽聽聽聽聽
    //聽Now聽call聽configurable/replacable聽part
    聽聽聽聽聽聽聽聽聽聽聽聽DoAlgoStep3();

    聽聽聽聽聽聽聽聽聽聽聽聽
    //聽step聽4聽goes聽here
    聽聽聽聽聽聽聽聽聽聽聽聽Console.WriteLine("In聽Algorithm聽-聽DoAlgoStep4");聽聽聽聽聽聽聽聽聽聽聽聽
    聽聽聽聽聽聽聽聽聽聽聽聽
    //聽.聽.聽.聽

    聽聽聽聽聽聽聽聽聽聽聽聽
    //聽Now聽call聽next聽configurable聽part
    聽聽聽聽聽聽聽聽聽聽聽聽DoAlgoStep5();
    聽聽聽聽聽聽聽聽}


    聽聽聽聽聽聽聽聽
    virtualpublicvoid聽DoAlgoStep3()
    聽聽聽聽聽聽聽聽
    {
    聽聽聽聽聽聽聽聽聽聽聽聽Console.WriteLine(
    "In聽Algorithm聽-聽DoAlgoStep3");聽聽聽聽聽聽聽聽
    聽聽聽聽聽聽聽聽}


    聽聽聽聽聽聽聽聽
    virtualpublicvoid聽DoAlgoStep5()
    聽聽聽聽聽聽聽聽
    {
    聽聽聽聽聽聽聽聽聽聽聽聽Console.WriteLine(
    "In聽Algorithm聽-聽DoAlgoStep5");聽聽聽聽聽聽聽聽聽聽聽聽
    聽聽聽聽聽聽聽聽}

    聽聽聽聽}


    聽聽聽聽
    class聽CustomAlgorithm聽:聽Algorithm
    聽聽聽聽
    {
    聽聽聽聽聽聽聽聽
    publicoverridevoid聽DoAlgoStep3()
    聽聽聽聽聽聽聽聽
    {
    聽聽聽聽聽聽聽聽聽聽聽聽Console.WriteLine(
    "In聽CustomAlgorithm聽-聽DoAlgoStep3");
    聽聽聽聽聽聽聽聽}


    聽聽聽聽聽聽聽聽
    publicoverridevoid聽DoAlgoStep5()
    聽聽聽聽聽聽聽聽
    {
    聽聽聽聽聽聽聽聽聽聽聽聽Console.WriteLine(
    "In聽CustomAlgorithm聽-聽DoAlgoStep5");
    聽聽聽聽聽聽聽聽}

    聽聽聽聽}


    聽聽聽聽
    ///<summary>
    聽聽聽聽
    ///聽聽聽聽Summary聽description聽for聽Client.
    聽聽聽聽
    ///</summary>

    聽聽聽聽publicclass聽Client
    聽聽聽聽
    {
    聽聽聽聽聽聽聽聽
    publicstaticint聽Main(string[]聽args)
    聽聽聽聽聽聽聽聽
    {
    聽聽聽聽聽聽聽聽聽聽聽聽CustomAlgorithm聽c聽
    =new聽CustomAlgorithm();

    聽聽聽聽聽聽聽聽聽聽聽聽c.DoAlgorithm();

    聽聽聽聽聽聽聽聽聽聽聽聽
    return0;
    聽聽聽聽聽聽聽聽}

    聽聽聽聽}

    }

    妯℃澘鏂規硶錛圱emplate Method錛夋ā寮?

    鍑嗗涓涓娊璞$被錛屽皢閮ㄥ垎閫昏緫浠ュ叿浣撴柟娉曚互鍙婂叿浣撴瀯閫犲瓙鐨勫艦寮忓疄鐜幫紝鐒跺悗澹版槑涓浜涙娊璞℃柟娉曟潵榪嬌瀛愮被瀹炵幇鍓╀綑鐨勯昏緫銆備笉鍚岀殑瀛愮被鍙互浠ヤ笉鍚岀殑鏂瑰紡瀹炵幇榪欎簺鎶借薄鏂規硶錛屼粠鑰屽鍓╀綑鐨勯昏緫鏈変笉鍚岀殑瀹炵幇銆傝繖灝辨槸妯$増鏂規硶妯″紡鐨勭敤鎰忋?/p>

    寰堝浜哄彲鑳芥病鏈夋兂鍒幫紝妯$増鏂規硶妯″紡瀹為檯涓婃槸鎵鏈夋ā寮忎腑鏈涓哄父瑙佺殑鍑犱釜妯″紡涔嬩竴錛岃屼笖寰堝浜哄彲鑳戒嬌鐢ㄨ繃妯$増鏂規硶妯″紡鑰屾病鏈夋剰璇嗗埌鑷繁宸茬粡浣跨敤浜嗚繖涓ā寮忋傛ā鐗堟柟娉曟ā寮忔槸鍩轟簬緇ф壙鐨勪唬鐮佸鐢ㄧ殑鍩烘湰鎶鏈紝妯$増鏂規硶妯″紡鐨勭粨鏋勫拰鐢ㄦ硶涔熸槸闈㈠悜瀵硅薄璁捐鐨勬牳蹇冦?/p>

    妯$増鏂規硶妯″紡闇瑕佸紑鍙戞娊璞$被鍜屽叿浣撳瓙綾葷殑璁捐甯堜箣闂寸殑鍗忎綔銆備竴涓璁″笀璐熻矗緇欏嚭涓涓畻娉曠殑杞粨鍜岄鏋訛紝鍙︿竴浜涜璁″笀鍒欒礋璐g粰鍑鴻繖涓畻娉曠殑鍚勪釜閫昏緫姝ラ銆備唬琛ㄨ繖浜涘叿浣撻昏緫姝ラ鐨勬柟娉曠О鍋氬熀鏈柟娉曪紙primitive method錛夛紱鑰屽皢榪欎簺鍩烘湰娉曟柟娉曟繪眹璧鋒潵鐨勬柟娉曞彨鍋氭ā鐗堟柟娉曪紙template method錛夛紝榪欎釜璁捐妯″紡鐨勫悕瀛楀氨鏄粠姝よ屾潵銆?br />聽妯$増鏂規硶妯″紡涓殑鏂規硶

    妯$増鏂規硶涓殑鏂規硶鍙互鍒嗕負涓ゅぇ綾伙細妯$増鏂規硶錛圱emplate Method錛夊拰鍩烘湰鏂規硶錛圥rimitive Method)銆?/p>

    妯$増鏂規硶

    涓涓ā鐗堟柟娉曟槸瀹氫箟鍦ㄦ娊璞$被涓殑錛屾妸鍩烘湰鎿嶄綔鏂規硶緇勫悎鍦ㄤ竴璧峰艦鎴愪竴涓葷畻娉曟垨涓涓昏涓虹殑鏂規硶銆傝繖涓ā鐗堟柟娉曚竴鑸細鍦ㄦ娊璞$被涓畾涔夛紝騫剁敱瀛愮被涓嶅姞浠ヤ慨鏀瑰湴瀹屽叏緇ф壙涓嬫潵銆?/p>

    鍩烘湰鏂規硶

    鍩烘湰鏂規硶鍙堝彲浠ュ垎涓轟笁縐嶏細鎶借薄鏂規硶錛圓bstract Method錛夈佸叿浣撴柟娉曪紙Concrete Method錛夊拰閽╁瓙鏂規硶錛圚ook Method錛夈?/p>

    鎶借薄鏂規硶錛氫竴涓娊璞℃柟娉曠敱鎶借薄綾誨0鏄庯紝鐢卞叿浣撳瓙綾誨疄鐜般傚湪C#璇█閲屼竴涓娊璞℃柟娉曚互abstract鍏抽敭瀛楁爣紺哄嚭鏉ャ?/p>

    鍏蜂綋鏂規硶錛氫竴涓叿浣撴柟娉曠敱鎶借薄綾誨0鏄庡茍瀹炵幇錛岃屽瓙綾誨茍涓嶅疄鐜版垨緗崲銆傚湪C#璇█閲岄潰錛屼竴涓叿浣撴柟娉曟病鏈塧bstract鍏抽敭瀛椼?/p>

    閽╁瓙鏂規硶錛氫竴涓挬瀛愭柟娉曠敱鎶借薄綾誨0鏄庡茍瀹炵幇錛岃屽瓙綾諱細鍔犱互鎵╁睍銆傞氬父鎶借薄綾葷粰鍑虹殑瀹炵幇鏄竴涓┖瀹炵幇錛屼綔涓烘柟娉曠殑榛樿瀹炵幇銆傦紙Visual FoxPro涓」鐩悜瀵煎緩绔嬬殑欏圭洰浼氫嬌鐢ㄤ竴涓狝ppHook綾誨疄鐜扮洃瑙嗛」鐩垚鍛樺彉鍖栵紝璋冩暣緋葷粺緇撴瀯鐨勫伐浣溿傦級閽╁瓙鏂規硶鐨勫悕瀛楅氬父浠o寮濮嬨?/p>

    ]]>
    妯″紡璁捐c#錛嶏紞琛屼負鍨嬶紞錛峣nterpreterhttp://www.shnenglu.com/mzty/archive/2006/01/03/2392.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 08:02:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2392.htmlhttp://www.shnenglu.com/mzty/comments/2392.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2392.html#Feedback0http://www.shnenglu.com/mzty/comments/commentRss/2392.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2392.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞緇撴瀯鍨嬶紞錛峱roxyhttp://www.shnenglu.com/mzty/archive/2006/01/03/2391.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 07:51:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2391.htmlhttp://www.shnenglu.com/mzty/comments/2391.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2391.html#Feedback2http://www.shnenglu.com/mzty/comments/commentRss/2391.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2391.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞緇撴瀯鍨嬶紞錛峟lyweighthttp://www.shnenglu.com/mzty/archive/2006/01/03/2390.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 07:50:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2390.htmlhttp://www.shnenglu.com/mzty/comments/2390.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2390.html#Feedback0http://www.shnenglu.com/mzty/comments/commentRss/2390.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2390.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞緇撴瀯鍨嬶紞錛峟acadehttp://www.shnenglu.com/mzty/archive/2006/01/03/2389.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 07:48:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2389.htmlhttp://www.shnenglu.com/mzty/comments/2389.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2389.html#Feedback1http://www.shnenglu.com/mzty/comments/commentRss/2389.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2389.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞緇撴瀯鍨嬶紞錛峝ecoratorhttp://www.shnenglu.com/mzty/archive/2006/01/03/2388.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 07:47:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2388.htmlhttp://www.shnenglu.com/mzty/comments/2388.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2388.html#Feedback3http://www.shnenglu.com/mzty/comments/commentRss/2388.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2388.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞緇撴瀯鍨嬶紞錛峜ompositehttp://www.shnenglu.com/mzty/archive/2006/01/03/2387.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 07:45:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2387.htmlhttp://www.shnenglu.com/mzty/comments/2387.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2387.html#Feedback2http://www.shnenglu.com/mzty/comments/commentRss/2387.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2387.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞緇撴瀯鍨嬶紞錛岯ridgehttp://www.shnenglu.com/mzty/archive/2006/01/03/2386.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 07:43:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2386.htmlhttp://www.shnenglu.com/mzty/comments/2386.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2386.html#Feedback2http://www.shnenglu.com/mzty/comments/commentRss/2386.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2386.html 鍚嶇О Bridge 緇撴瀯 o_bridge.bmp 鎰忓浘 灝嗘娊璞¢儴鍒嗕笌瀹冪殑瀹炵幇閮ㄥ垎鍒嗙錛屼嬌瀹冧滑閮藉彲浠ョ嫭绔嬪湴鍙樺寲銆?/TD> 閫傜敤鎬?/TD>
    • 浣犱笉甯屾湜鍦ㄦ娊璞″拰瀹冪殑瀹炵幇閮ㄥ垎涔嬮棿鏈変竴涓浐瀹氱殑緇戝畾鍏崇郴銆備緥濡傝繖縐嶆儏鍐靛彲鑳芥槸鍥犱負錛屽湪紼嬪簭榪愯鏃跺埢瀹炵幇閮ㄥ垎搴斿彲浠ヨ閫夋嫨鎴栬呭垏鎹€?
    • 綾葷殑鎶借薄浠ュ強瀹冪殑瀹炵幇閮藉簲璇ュ彲浠ラ氳繃鐢熸垚瀛愮被鐨勬柟娉曞姞浠ユ墿鍏呫傝繖鏃禕 r i d g e 妯″紡浣夸綘鍙互瀵逛笉鍚岀殑鎶借薄鎺ュ彛鍜屽疄鐜伴儴鍒嗚繘琛岀粍鍚堬紝騫跺垎鍒瀹冧滑榪涜鎵╁厖銆?
    • 瀵逛竴涓娊璞$殑瀹炵幇閮ㄥ垎鐨勪慨鏀瑰簲瀵瑰鎴蜂笉浜х敓褰卞搷錛屽嵆瀹㈡埛鐨勪唬鐮佷笉蹇呴噸鏂扮紪璇戙?
    • 錛圕 + +錛変綘鎯沖瀹㈡埛瀹屽叏闅愯棌鎶借薄鐨勫疄鐜伴儴鍒嗐傚湪C + +涓紝綾葷殑琛ㄧず鍦ㄧ被鎺ュ彛涓槸鍙鐨勩?
    • 鏈夎澶氱被瑕佺敓鎴愩傝繖鏍蜂竴縐嶇被灞傛緇撴瀯璇存槑浣犲繀欏誨皢涓涓璞″垎瑙f垚涓や釜閮ㄥ垎銆俁 u m b a u g h 縐拌繖縐嶇被灞傛緇撴瀯涓衡滃祵濂楃殑鏅寲鈥濓紙nested generalizations 錛夈?
    • 浣犳兂鍦ㄥ涓璞¢棿鍏變韓瀹炵幇錛堝彲鑳戒嬌鐢ㄥ紩鐢ㄨ鏁幫級錛屼絾鍚屾椂瑕佹眰瀹㈡埛騫朵笉鐭ラ亾榪欎竴鐐廣備竴涓畝鍗曠殑渚嬪瓙渚挎槸C o p l i e n 鐨凷 t r i n g 綾籟 C o p 9 2 ]錛屽湪榪欎釜綾諱腑澶氫釜瀵硅薄鍙互鍏變韓鍚屼竴涓瓧絎︿覆琛ㄧず錛圫 t r i n g R e p 錛夈?

    Code Example
    namespace Bridge_DesignPattern
    {
        
    using System;

        
    class Abstraction 
        
    {
            
    protected Implementation impToUse;

            
    public void SetImplementation(Implementation i)
            
    {
                impToUse 
    = i;
            }


            
    virtual public void DumpString(string str)
            
    {
                impToUse.DoStringOp(str);                   
            }

        }


        
    class DerivedAbstraction_One : Abstraction 
        
    {
            
    override public void DumpString(string str)
            
    {
                str 
    += ".com";
                impToUse.DoStringOp(str);            
            }
            
        }


        
    class Implementation 
        
    {
            
    public virtual void DoStringOp(string str)
            
    {
                Console.WriteLine(
    "Standard implementation - print string as is");
                Console.WriteLine(
    "string = {0}", str);
            }
            
        }


        
    class DerivedImplementation_One : Implementation 
        
    {
            
    override public void DoStringOp(string str)
            
    {
                Console.WriteLine(
    "DerivedImplementation_One - don't print string");
            }
        
        }


        
    class DerivedImplementation_Two : Implementation 
        
    {
            
    override public void DoStringOp(string str)
            
    {
                Console.WriteLine(
    "DerivedImplementation_Two - print string twice");
                Console.WriteLine(
    "string = {0}", str);
                Console.WriteLine(
    "string = {0}", str);
            }
        
        }

        
        
    /// <summary>
        
    ///    Summary description for Client.
        
    /// </summary>

        public class Client
        
    {
            Abstraction SetupMyParticularAbstraction() 
            
    {
                
    // we localize to this method the decision which abstraction and
                
    // which implementation to use. These need to be decided 
                
    // somewhere and we do it here. All teh rest of the client 
                
    // code can work against the abstraction object. 
                Abstraction a = new DerivedAbstraction_One();
                a.SetImplementation(
    new DerivedImplementation_Two());
                
    return a;
            }


            
    public static int Main(string[] args)
            
    {         
                Client c 
    = new Client();
                Abstraction a 
    = c.SetupMyParticularAbstraction();
                    
                
    // From here on client code thinks it is talking to the 
                
    // abstraction, and will not need to be changed as 
                
    // derived abstractions are changed. 

                
    // more client code using the abstraction goes here 
                
    // . . . 
                a.DumpString("Clipcode");

                
    return 0;
            }

        }

    }



    ]]>
    妯″紡璁捐c#錛嶏紞緇撴瀯鍨嬶紞錛岮dapterhttp://www.shnenglu.com/mzty/archive/2006/01/03/2385.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 07:41:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2385.htmlhttp://www.shnenglu.com/mzty/comments/2385.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2385.html#Feedback3http://www.shnenglu.com/mzty/comments/commentRss/2385.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2385.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞鍒涘緩鍨嬶紞錛峉ingletonhttp://www.shnenglu.com/mzty/archive/2006/01/03/2384.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 06:58:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2384.htmlhttp://www.shnenglu.com/mzty/comments/2384.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2384.html#Feedback3http://www.shnenglu.com/mzty/comments/commentRss/2384.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2384.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞鍒涘緩鍨嬶紞錛峆rototypehttp://www.shnenglu.com/mzty/archive/2006/01/03/2383.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 06:53:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2383.htmlhttp://www.shnenglu.com/mzty/comments/2383.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2383.html#Feedback2http://www.shnenglu.com/mzty/comments/commentRss/2383.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2383.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞鍒涘緩鍨嬶紞錛岯uilderhttp://www.shnenglu.com/mzty/archive/2006/01/03/2381.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 06:47:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2381.htmlhttp://www.shnenglu.com/mzty/comments/2381.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2381.html#Feedback2http://www.shnenglu.com/mzty/comments/commentRss/2381.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2381.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞鍒涘緩鍨嬶紞錛岮bstractFactoryhttp://www.shnenglu.com/mzty/archive/2006/01/03/2379.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 06:43:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2379.htmlhttp://www.shnenglu.com/mzty/comments/2379.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2379.html#Feedback3http://www.shnenglu.com/mzty/comments/commentRss/2379.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2379.html闃呰鍏ㄦ枃

    ]]>
    妯″紡璁捐c#錛嶏紞鍒涘緩鍨嬶紞錛峟actory methodhttp://www.shnenglu.com/mzty/archive/2006/01/03/2377.html姊﹀湪澶╂動姊﹀湪澶╂動Tue, 03 Jan 2006 06:28:00 GMThttp://www.shnenglu.com/mzty/archive/2006/01/03/2377.htmlhttp://www.shnenglu.com/mzty/comments/2377.htmlhttp://www.shnenglu.com/mzty/archive/2006/01/03/2377.html#Feedback2http://www.shnenglu.com/mzty/comments/commentRss/2377.htmlhttp://www.shnenglu.com/mzty/services/trackbacks/2377.html闃呰鍏ㄦ枃

    ]]>
    23縐嶇粡鍏歌璁℃ā寮?/title><link>http://www.shnenglu.com/mzty/archive/2006/01/03/2376.html</link><dc:creator>姊﹀湪澶╂動</dc:creator><author>姊﹀湪澶╂動</author><pubDate>Tue, 03 Jan 2006 06:20:00 GMT</pubDate><guid>http://www.shnenglu.com/mzty/archive/2006/01/03/2376.html</guid><wfw:comment>http://www.shnenglu.com/mzty/comments/2376.html</wfw:comment><comments>http://www.shnenglu.com/mzty/archive/2006/01/03/2376.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/mzty/comments/commentRss/2376.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/mzty/services/trackbacks/2376.html</trackback:ping><description><![CDATA[<DIV align=center> <TABLE cellSpacing=1 cellPadding=3 width="70%" align=center border=1> <TBODY> <TR> <TD></TD> <TD>鍒涘緩鍨?/TD> <TD>緇撴瀯鍨?/TD> <TD>琛屼負鍨?/TD></TR> <TR> <TD>綾?/TD> <TD vAlign=top><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#FactoryMethod">Factory Method</A> </TD> <TD vAlign=top><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Adapter_Class">Adapter_Class</A> </TD> <TD vAlign=top><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Interpreter">Interpreter</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#TemplateMethod">Template Method</A> </TD></TR> <TR> <TD>瀵硅薄</TD> <TD vAlign=top><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#AbstractFactory">Abstract Factory</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Builder">Builder</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Prototype">Prototype</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Singleton">Singleton</A> </TD> <TD vAlign=top><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Adapter_Object">Adapter_Object</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Bridge">Bridge</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Composite">Composite</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Decorator">Decorator</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Facade">Facade</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Flyweight">Flyweight</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Proxy">Proxy</A> </TD> <TD vAlign=top><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#ChainofResponsibility">Chain of Responsibility</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Command">Command</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Iterator">Iterator</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Mediator">Mediator</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Memento">Memento</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Observer">Observer</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#State">State</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Strategy">Strategy</A><BR><A href="mk:@MSITStore:C:\Documents%20and%20Settings\xhzhu\Desktop\b91e_dpmini.chm::/璁捐妯″紡榪蜂綘鎵嬪唽.htm#Visitor">Visitor</A> </TD></TR> <TR> <TD>姒傝</TD> <TD colSpan=3><A name=OverView><IMG title=OverView src="http://www.shnenglu.com/images/cppblog_com/mzty/713/r_design.bmp" useMap=#OverView border=0></A></TD></TR></TBODY></TABLE></DIV><img src ="http://www.shnenglu.com/mzty/aggbug/2376.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/mzty/" target="_blank">姊﹀湪澶╂動</a> 2006-01-03 14:20 <a href="http://www.shnenglu.com/mzty/archive/2006/01/03/2376.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.yghzby.cn" target="_blank">漂亮人妻被中出中文字幕久久</a>| <a href="http://www.qfzld.cn" target="_blank">狠狠干狠狠久久</a>| <a href="http://www.liess.cn" target="_blank">久久精品桃花综合</a>| <a href="http://www.rideos.cn" target="_blank">国产福利电影一区二区三区,免费久久久久久久精 </a>| <a href="http://www.vnaiman.cn" target="_blank">AV无码久久久久不卡网站下载</a>| <a href="http://www.hlbelss.org.cn" target="_blank">久久99国产精品一区二区</a>| <a href="http://www.rocchetta.com.cn" target="_blank">国产精品久久久久久久午夜片</a>| <a href="http://www.omsf.cn" target="_blank">一级女性全黄久久生活片免费</a>| <a href="http://www.feschain.cn" target="_blank">性欧美大战久久久久久久久</a>| <a href="http://www.hardwareman.cn" target="_blank">国产精品视频久久</a>| <a href="http://www.drqv.cn" target="_blank">亚洲综合熟女久久久30p</a>| <a href="http://www.jshzyj.cn" target="_blank">91久久精品国产成人久久</a>| <a href="http://www.ebsiask.cn" target="_blank">久久精品国产99国产精品导航</a>| <a href="http://www.bhga.cn" target="_blank">色噜噜狠狠先锋影音久久</a>| <a href="http://www.dysky.cn" target="_blank">亚洲va久久久噜噜噜久久男同</a>| <a href="http://www.pz25555.cn" target="_blank">九九热久久免费视频</a>| <a href="http://www.shangxuewenhua.cn" target="_blank">日韩精品久久无码人妻中文字幕 </a>| <a href="http://www.hktjj.cn" target="_blank">久久精品国产99国产精偷</a>| <a href="http://www.mxklj.cn" target="_blank">久久婷婷是五月综合色狠狠</a>| <a href="http://www.j19785.cn" target="_blank">久久99国产精品久久</a>| <a href="http://www.iceplaza.cn" target="_blank">日日躁夜夜躁狠狠久久AV</a>| <a href="http://www.pydjango.cn" target="_blank">思思久久99热免费精品6</a>| <a href="http://www.shishanfz.cn" target="_blank">精品少妇人妻av无码久久</a>| <a href="http://www.shairproperty.cn" target="_blank">久久国内免费视频</a>| <a href="http://www.hwumbrella.cn" target="_blank">国产毛片久久久久久国产毛片 </a>| <a href="http://www.52zqsq.cn" target="_blank">久久伊人精品青青草原高清</a>| <a href="http://www.zgwlptw.cn" target="_blank">亚洲国产精品无码久久久秋霞2</a>| <a href="http://www.jipiaocq.cn" target="_blank">久久久久九九精品影院</a>| <a href="http://www.hjj9588.cn" target="_blank">久久久国产精品网站</a>| <a href="http://www.kwk9605.cn" target="_blank">www.久久热</a>| <a href="http://www.youhezulin.cn" target="_blank">国产精品久久久久久</a>| <a href="http://www.metropolojinjianghotel.cn" target="_blank">精品人妻伦九区久久AAA片69</a>| <a href="http://www.wanhejingshui.cn" target="_blank">欧美激情精品久久久久久久</a>| <a href="http://www.wwcx.com.cn" target="_blank">亚洲国产精品久久久久婷婷软件</a>| <a href="http://www.wxwyx.cn" target="_blank">丁香狠狠色婷婷久久综合</a>| <a href="http://www.173ec.cn" target="_blank">精品综合久久久久久888蜜芽</a>| <a href="http://www.s9990.cn" target="_blank">人妻无码久久一区二区三区免费 </a>| <a href="http://www.yousms.cn" target="_blank">久久精品国产亚洲AV无码麻豆 </a>| <a href="http://www.jiulongpu.cn" target="_blank">亚洲欧洲精品成人久久奇米网</a>| <a href="http://www.air-ticket.cn" target="_blank">青青草原综合久久大伊人精品</a>| <a href="http://www.caipusheji2016.cn" target="_blank">精品无码久久久久久尤物</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>