锘??xml version="1.0" encoding="utf-8" standalone="yes"?>内射干少妇亚洲69XXX,亚洲AV日韩AV一区二区三曲,亚洲av综合av一区http://www.tkk7.com/zhoumin007/category/9003.html璁板綍鎴戠殑鎵鍋氭墍鎬?/description>zh-cnFri, 02 Mar 2007 06:40:16 GMTFri, 02 Mar 2007 06:40:16 GMT60Singletonhttp://www.tkk7.com/zhoumin007/articles/38287.htmlzhouminzhouminThu, 30 Mar 2006 09:15:00 GMThttp://www.tkk7.com/zhoumin007/articles/38287.htmlhttp://www.tkk7.com/zhoumin007/comments/38287.htmlhttp://www.tkk7.com/zhoumin007/articles/38287.html#Feedback0http://www.tkk7.com/zhoumin007/comments/commentRss/38287.htmlhttp://www.tkk7.com/zhoumin007/services/trackbacks/38287.html聽聽聽 鏌愪簺鎯呭喌涓嬩竴涓被鍙兘鏈変竴涓疄渚嬶紝濡倀hread pool,caches,objects that handle preferences and registry settings,objects used for logging,瀵硅繖浜涙儏鍐典笅濡傛灉浜х敓澶氫簬涓涓殑瀹炰緥浼?xì)瀵艰嚧涓嶆甯哥殑琛屼负鍜寢躬璐硅祫婧愩?br />聽聽
榪欐牱鏁扮粍涔熸湁浜?jiǎn)Iterator鎺ュ彛錛屽鎴風(fēng)涓嶇敤綆℃槸鐢ㄦ暟緇勫瓨鐨勫璞¤繕鏄疞ist錛岄兘鐢↖terator鐨勬柟娉曠粺涓澶勭悊銆?br /> 聽 The Iterator Pattern provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
鍙互鍙戠幇錛岃繖涓や釜綾諱腑prepareRecipe()鏂規(guī)硶錛岄儴鍒嗕唬鐮佹槸涓鏍風(fēng)殑錛屾墍浠ユ妸榪欎釜鏂規(guī)硶鎻愬埌鍩虹被涓紝鍏朵腑boilWater()鍜宲ourInCup()鏂規(guī)硶鎵鏈夊瓙綾婚兘鏄竴鏍風(fēng)殑錛屽彲浠ュ湪鍩虹被瀹炵幇錛屽叾瀹冧袱涓柟娉曚負(fù)abstract錛屽張鍏蜂綋瀛愮被鏉ュ疄鐜般?br />聽 The Template Pattern defines the skeleton of an alogrithm in a method,deffering some steps to subclass. 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Template Pattern lets subclass redefine certain steps of an alogrithm without changing the alogrithm's structure.
聽聽聽 榪欏叾瀹炴槸涓涓瘮杈冩櫘閫氱殑瀹屾暣闇姹傦紝榪欑‘娑夊強(qiáng)鍒頒簲鍏釜綾伙紝濡傛灉鐩存帴緇欒繖鏍風(fēng)殑鎺ュ彛緇檆lient錛屽崄鍒嗕笉鏂逛究錛屾垜浠簲璇ユ牴鎹渶姹傦紝鎶婄粏鑺傚寘瑁呰搗鏉ワ紝鐩存帴鎻愪緵涓涓猻howMovie錛堝寘瑁呬互涓婂疄鐜幫級(jí)鐨勬柟娉曠粰瀹㈡埛绔?br /> 聽 The Facade Pattern provides a unified interface to a set of interfaces聽in a聽subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.聽
聽聽聽聽 The Adapter Pattern converts the interface of聽 a class into another interface the client expect.Adapter lets classes work together that couldn't otherwise because of聽 incompatible interfaces. 聽聽聽鍜孌ecorator妯″紡涓嶅悓錛宒ecorator瀵圭被鍖呰鍚庢槸澧炲姞瀹冪殑鍔熻兘錛岃孉dapter鏄敼鍙樻帴鍙e艦寮忎互閫傜敤client闇瑕?br />聽聽聽 聽聽 搴旂敤瀹炰緥錛歐INE鍦↙inux鐜涓嬭繍琛學(xué)indows紼嬪簭銆?br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 JDBC/ODBC妗ャ?img src ="http://www.tkk7.com/zhoumin007/aggbug/38216.html" width = "1" height = "1" />
The聽Factory Method Pattern defines an interface for creation聽an object,but let subclasses decide which class to聽 instantiate.Factory Method聽lets a class defer instantiation to subclasses.
]]>Observerhttp://www.tkk7.com/zhoumin007/articles/37670.htmlzhouminzhouminMon, 27 Mar 2006 11:17:00 GMThttp://www.tkk7.com/zhoumin007/articles/37670.htmlhttp://www.tkk7.com/zhoumin007/comments/37670.htmlhttp://www.tkk7.com/zhoumin007/articles/37670.html#Feedback0http://www.tkk7.com/zhoumin007/comments/commentRss/37670.htmlhttp://www.tkk7.com/zhoumin007/services/trackbacks/37670.html涓錛歝ase context錛?br />聽聽聽聽 鏈変竴涓皵璞′俊鎭被WeatherData錛屽睘鎬у寘鎷瑃emperature錛宧umidity絳夛紝鐜版湁涓ょ鏄劇ずWeatherData鏁版嵁鐨勭被WeatherDataDisplay1鍜學(xué)eatherDataDisplay2錛屽綋WeatherData鐨勪俊鎭敼鍙樻椂錛岃繖涓や釜鏄劇ず鐨勭被涓殑鏁版嵁涔熸敼鍙橈紝緇存姢鎬ф柟闈紝鍙兘浼?xì)鏈壗W笁縐嶆樉紺烘柟娉曪紝鏌愪釜鏄劇ず綾誨彲浠ョ敵璇蜂笉鏍規(guī)嵁WeatherData鏁版嵁瀹炴椂鏀瑰彉銆?br /> 浜岋細(xì) 聽聽聽聽鐩墠鐜版柟娉曪紝 WeatherData涓? 聽聽聽聽 public void measurementsChanged() 聽聽聽 { 聽聽聽聽聽聽聽聽 display1.update(getTemperature(),getHumidity()); 聽聽聽聽聽聽聽聽 display2.update(getTemperature(),getHumidity()); 聽聽聽 }聽 聽聽聽 浣嗘柟娉曚綋涓殑浠g爜鏄彲鑳戒細(xì)鍙樼殑錛屾湁display3鐨勬椂鍊欙紝蹇呴』寰椾慨鏀逛唬鐮併?br />涓夛細(xì) 聽聽聽聽 The Observer pattern錛歞efines a one-to-many dependency between objects so that when one object changes state, 聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 all of its dependents are notified and updated automatically.
]]>Strategyhttp://www.tkk7.com/zhoumin007/articles/37629.htmlzhouminzhouminMon, 27 Mar 2006 08:24:00 GMThttp://www.tkk7.com/zhoumin007/articles/37629.htmlhttp://www.tkk7.com/zhoumin007/comments/37629.htmlhttp://www.tkk7.com/zhoumin007/articles/37629.html#Feedback0http://www.tkk7.com/zhoumin007/comments/commentRss/37629.htmlhttp://www.tkk7.com/zhoumin007/services/trackbacks/37629.html聽鐜拌璁′竴涓叧浜庨腑瀛愮殑緋葷粺錛屼竴涓娊璞$被Duck錛屾柟娉曚負(fù)quack(),swim(),abstract display()(鍏蜂綋瀛惵犅?綾誨疄鐜?銆傜幇闇姹備負(fù)鏈夐儴鍒嗙被鍨嬬殑楦瓙鍙互fly(),濡備綍瀹炵幇銆?br />聽聽 a:緇ф壙錛氭妸fly()鎻愬埌Duck綾諱腑錛屽彲瀹炵幇浠g爜澶嶇敤銆?br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 闂錛氳繚鍙嶇戶鎵垮師鍒欙紝鐖剁被鐨勬柟娉曞繀欏繪槸鎵鏈夊瓙綾婚兘鍏鋒湁鐨勮涓猴紝浠g爜緇存姢 鏃跺鍔犲叆涓聽 縐嶆柊綾?鍨嬫湪澶撮腑灝辨病鏈塮ly()琛屼負(fù)銆?br /> 聽 b:鎺ュ彛錛氬啓涓涓猣lyable鎺ュ彛錛屾墍鏈夋湁fly()琛屼負(fù)鐨勯腑瀛愰兘瀹炵幇榪欎釜鎺ュ彛銆?br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 闂錛氫笉鑳藉疄鐜頒唬鐮佸鐢ㄣ?br />聽聽 2: 閲嶆柊鍒嗘瀽錛?br />聽聽聽 fly()琛屼負(fù)涓嶆槸姣忎釜瀛愮被閮芥湁錛宖ly()鐨勫叿浣撳疄鐜板彲鑳戒細(xì)鍙樺寲錛堟湁鐨勬槸鐢ㄧ繀鑶椋炶錛屾湁鐨勬槸婊戣錛?鎴栨槸鍏跺畠娌℃湁鍙戠幇鐨勬柟娉曪紝鎬諱箣瀹冩槸浼?xì)鍙樼殑锛坈hange錛宎dd錛夛級(jí)銆?br />聽聽聽 Design Principal錛欼dentify the aspects of your application that vary and seperate them from what stays the same銆?br />聽聽聽 錛坱ake the parts that vary and encapsulate them,so that later you can alter and extend the parts that vary without affecting those don't聽錛?br />聽聽 瑙e喅鏂規(guī)硶錛?br />聽聽聽聽聽聽聽聽聽 鍐橣lyBehavior鎺ュ彛錛屽拰涓や釜瀹炵幇綾籉lyWithWings鍜孎lyNoWay錛岃繖鏍鋒妸Fly鐨勮涓轟粠duck綾葷殑鍐呴儴鎻愪簡(jiǎn)鍑烘潵錛屾垜浠彲浠ヤ慨鏀瑰拰澧炲姞琛屼負(fù)鑰屼笉褰卞搷鍏跺畠浠g爜銆?br />聽聽聽聽聽聽聽聽聽 鎶奆lyBehavior瀹炰緥浣滀負(fù)Duck鐨勫睘鎬э紝瀛愮被鏋勯犳椂鍙互閫氳繃new FlyBehavior鐨勫疄鐜扮被璁劇疆姝ゅ睘鎬э紝錛堝洜涓篎lyBehavior鏄帴鍙o紝鎴戜滑鍙互鍦≧untime 鏀瑰彉瀹冿級(jí)錛岀劧鍚庡湪Duck鍐檖erformFly()瀹炵幇鏂規(guī)硶涓轟唬鐞唂lyBehavior.fly()銆?br />聽聽聽 Design Principal錛欶avor composition than inheirtance. 聽聽聽 (1:change behavior at runtime.2:encapsulate a family of algorithms into their own classes)
聽聽 Strategy pattern: define a family of algorithms,encapsulates each one,and make them interchangeable. Strategy lets the algorithm vary independently from the client that use it.