JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Software Design  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to topicthreaded modego to previous topicgo to next topic
本主題所含的標籤
無標籤
作者 A GIKO CATalog of Design Patterns(Giko貓談DP 四格漫畫) [精華]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-07-23 02:14 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
由於圖的關係,本文章用IE看才能有最佳效果

原網址 http://www.hyuki.com/dp/cat_index.html
作者 結城浩

原作者同意翻譯並同意轉載

在這邊主要是將日本2ch.net的giko貓們來介紹一些Design Pattern(?)
但是單純的耍寶會有點無聊,因此將內容盡量和技術扯到關係,如果不了解
這個pattern,那就不會懂得笑點(我盡量做到).

要轉載請著名以上原作者出處
中文轉載請著名koji at www.javaworld.com.tw

登場的貓咪們

giko貓
  ∧ ∧
  (,,゚⑸゚)
   |コ コ
 ∼  |
  ∪ ∪

molala
  ∧_∧
 ( ・∀・)
 (    )
 | | |
 (__)_)

迷你giko

  ∧ ∧
 (,,・?・)
 @_)

Si(鋼琴do re mi fa so ra si 的 si)
   _∧ ∧___
 ╱_(*゚み゚)_╱╲
╱|   ∪∪ | ╲╱
 |_______|╱


koji edited on 2004-03-12 12:11
reply to postreply to post
作者 Part1 Giko貓與DP [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-07-23 02:29 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part1 Giko貓與DP

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 那就是GoF的Pattern阿....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Design Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 不懂Pattern還敢談物件導向...啊
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 我...我沒說阿...
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 不懂Pattern還敢談程式設計...啊
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 我就說我沒有說阿!!!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_Patterns.html


browser edited on 2003-07-23 08:30
reply to postreply to post
作者 Part2 [DP] Abstract Factory Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-07-23 02:30 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part2 [DP] Abstract Factory Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 並不是由super class來產生物件....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Abstract Factory嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 實際產生物件的動作是由sub class來做…恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 是,是的.都由ConcreteFactory來產生
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 所以說做出來的東西都是水泥製品…恩
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 怎麼可能阿!!!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_AbstractFactory.html


browser edited on 2003-07-24 16:27
reply to postreply to post
作者 Part3 [DP] Singleton pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-07-23 02:34 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part3 [DP] Singleton pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 把constructor改成private....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Singleton Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 是不是不想讓其他Class new阿…
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩、可、可以這麼說…
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 其他工程師是不能相信的…恩
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 我又沒說!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_Singleton.html


browser edited on 2003-07-24 16:28
reply to postreply to post
作者 Part4 [DP] Builder Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-07-23 02:36 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part4 [DP] Builder Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 最後在用getResult()來取得結果....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Builder Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| Director使用Builder來建構複雜的物件…恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 但是具體的建構則是交給ConcreteBuilder…
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 然後最後在由Client榨取…恩
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 不是榨取拉!!!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_Builder.html


browser edited on 2003-07-24 16:29
reply to postreply to post
作者 Part5 [DP] Bridge Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-07-23 02:36 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part5 [DP] Bridge Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 兩個class階層中間搭上一個關係....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Bridge Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 讓兩個class階層可以獨立擴展…恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩..可,可以這麼說…
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 所以兩個開發部門怎樣吵架都沒關係…恩
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 沒有人那樣說拉!!!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_Bridge.html


browser edited on 2003-07-24 16:29
reply to postreply to post
作者 Part6 [DP] Factory Method Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-07-24 16:16 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part6 [DP] Factory Method Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 也可以說使用Template Method來生成物件....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Factory Method Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| frmaework的一端在事前是不會知道會被物件化的sub Class…恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩..可,可以這麼說…雖然說有許多場合....
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 所以說到完成之前,完全不知道會做出怎樣的東西…恩
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 怎麼可能拉!!!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_FactoryMethod.html


koji edited on 2003-07-24 16:36
reply to postreply to post
作者 Part7 [DP] Proxy Pattern [Re:koji] [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-08-08 20:35 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part7 [DP] Proxy Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < RMI算是Remote Proxy的一個例子....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Proxy Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 被情勢所逼才製作物件的一種Pattern…恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩..那算是Virtual Proxy的一種....
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 截止日快到了才開始coding…恩
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 我又沒說!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

         /
  ∧ ∧ < 這可笑不出來
  (    ) ╲_____________
∼(___ノ 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_Proxy.html


koji edited on 2003-08-08 20:40
reply to postreply to post
作者 Part8 [DP] State Pattern [Re:koji] [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-08-08 21:02 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part8 [DP] State Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 製作為了表現各種狀態的ConcreteState....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是State Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 用來判斷狀態的if就可以不用了…恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 因為可以不需要因狀態不同而產生的分歧了...
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 相反的switch碼會增加…恩
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 我又沒說!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

AbstractGikoState與ConcreteGikoState們

  ∧ ∧   ╱
 (,,    )< AbstractGikoState
 @_)   ╲__________

  △
  |
  |       ∧ ∧   ╱
  |―――  (,,・∀・)< 微笑ConcreteGikoState
  |      @_)   ╲__________
  |     
  |       ∧ ∧   ╱
  |―――  (,,・ー・)< 冷笑ConcreteGikoState
  |      @_)   ╲__________
  |     
  |       ∧ ∧   ╱
  |―――  (,, ;д ; )< 嗚嗚ConcreteGikoState
  |      @_)   ╲__________
  |     
  |       ∧ ∧   ╱
  |―――  (,,-x-)< 睡睡ConcreteGikoState
         @_)   ╲__________

from http://www.hyuki.com/dp/cat_State.html


koji edited on 2003-08-08 21:04
reply to postreply to post
作者 Part9 [DP] Template Method Pattern [Re:koji] [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-08-25 16:19 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part9 [DP] Template Method Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 將此method在子類別中override....
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Template Method 嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 處理的骨幹都在super class中就決定好了…恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩恩...如同您說的...
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 製作子類別的時候根本不會感到辛勞…恩
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 我又沒說!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


reply to postreply to post
作者 Part10 [DP] Adapter Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-10-19 20:20 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part10 [DP] Adapter Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 由Adapter來實現Target的抽象方法....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Adapter Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| Adaptee會被隱藏住,實際上只看的到Target的API…恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩,恩.確實如此~
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 沒用的Adaptee,給它死!!!
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 那樣就不能做Adapter了拉!!!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_Adapter.html


reply to postreply to post
作者 Part11 [DP] Flyweight Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2003-10-19 20:27 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part11 [DP] Flyweight Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 如同這樣把物件共有....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Flyweight Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 共有的話,可以讓記憶體的消耗減少…恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩,恩.確實如此~
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 在共產主義社會下,減肥是不必要的!!!
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 我又沒說!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

銘菓UnsharedConcreteFlyweight

      ./∧_∧ ∧_∧ ∧_∧ ∧_∧  /|
      /( ・∀・)( ・∀・)( ・∀・)( ・∀・) / .|
     ./∧_∧ ∧_∧ ∧_∧ ∧_∧  / | ___________
    /( ・∀・)( ・∀・)( ・∀・)( ・∀・) /  / ╱
   ./∧_∧ ∧_∧ ∧_∧ ∧_∧  /  / < 不是能共有?
   /( ・∀・)( ・∀・)( ・∀・)( ・∀・) /  /   ╲___________
  ./∧_∧ ∧_∧ ∧_∧ ∧_∧  /  /
 /( ・∀・)( ・∀・)( ・∀・)( ・∀・) /  /
 |_______________|  /
 | 銘菓UnsharedConcreteFlyweight| ./
 |_______________|/

from http://www.hyuki.com/dp/cat_Flyweight.html


koji edited on 2003-10-19 20:29
reply to postreply to post
作者 Part12 [DP] Iterator Pattern [Re:koji] [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2004-01-29 04:01 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part12 [DP] Iterator Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < Aggregate擁有產生Iterator的method....
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Iterator Pattern 嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 把ConcreteAggregate的實作部份都隱藏起來的狀態下可以scan的Pattern…恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩恩...這是很重要的一點...
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| ConcreteAggregate的coding就算亂七八糟也沒差…恩
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 我又沒說!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_Iterator.html


koji edited on 2004-01-29 04:18
reply to postreply to post
作者 Re:Part13 [DP] Visitor Pattern [Re:koji] [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2004-01-29 04:17 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part13 [DP] Visitor Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 這樣data構造和處理就可以分離~了....
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Visitorr Pattern 嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 新追加ConcreteVisitor會變的很輕鬆…恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩恩...您可真熟...
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 不要考慮再利用,大力給他新增下去…恩
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 是要重複利用ConcreteElement拉!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________
  ____∧ ∧  ╱
∼′ __ ( ゚Д゚)< …poor。
  UU U U  ╲_____________

from http://www.hyuki.com/dp/cat_Visitor.html


koji edited on 2004-01-29 04:19
reply to postreply to post
作者 Part14 [DP] Strategy Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2004-01-29 04:28 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part14 [DP] Strategy Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 可以跟別的ConcreteStrategy交換..恩....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Strategy Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 跟State Pattern一樣的Pattern哪
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 如果只看類別圖, 很容易誤會成如您所說的....
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 不同的地方只有名字…恩
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 是目的不一樣拉!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

         /
  ∧ ∧ < 喔~~原來如此
  (    ) ╲_____________
∼(___ノ  旦

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_Strategy.html


reply to postreply to post
作者 Part15 [DP] Facade Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2004-03-12 11:52 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part15 [DP] Facade Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 這樣就可以很簡單的利用這些複雜的sub system了....恩。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Facade Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 提供簡化的API給Client哪
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 是呀....可以說是簡化過後的窗口
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 完全不考慮努力完成複雜系統的人的心情…恩
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 我又沒說!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

―――――――――

Facade bartender

_______________
我要琴湯尼。
______ _______ ╱ 好的。
_______V_______|   ______________
 日 M [] 0 Ⅱ Ⅱレ
======〃∧_∧=
 Ⅱ ∩    %(´∀` ) ____________
__ ∧ ∧__∧_∧__.)_  ╱
  (   ,,)日(    )∇  < 我要莫斯科騾子。
― /   |―-(    )――  ╲_____
 (___ノ   ━┳━)
 ━┳━   └┃―・゙
_┻_____┻_________________________________________

―――――――――――――
_________________
這個酒保怎麼這麼遜。 ____________
__ ___________/ ╱
_∨____________|(喂喂、給Facade bartender一點面子吧)
 日 M [] 0 Ⅱ Ⅱ レ―――――――
======= .∧_∧=
 Ⅱ ∩    %(´∀` ;) ____________
__ ∧ ∧__∧_∧__.)_  ╱
  ( ゚Д゚,)日( ´∀`)∇  < 要不要由我來代替做一個?
― /   |―-(    )――  ╲_____
 (___ノ   ━┳━)
━┳━   └┃―・゙
_┻_____┻_________________________________________
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_Facade.html


koji edited on 2004-03-12 18:32
reply to postreply to post
作者 Part16 [DP] Chain of Responsibility Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2004-03-29 20:12 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part16 [DP] Chain of Responsibility Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 也就是說..有連鎖性的委讓動作..恩....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Chain of Responsibility Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 如果自己不處理的話就委讓給下一個ConcreteHandler
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩...恩恩..沒錯....
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 誰管他處理不處理的了.恩.
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 我又沒說!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

         /
  ∧ ∧ < 但是,我想應該就是這種pattern.
  (    ) ╲_____________
∼(___ノ  旦

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_ChainOfResponsibility.html


reply to postreply to post
作者 Part17 [DP] Command Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2004-03-29 20:14 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part17 [DP] Command Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < client來的要求會變成comman並queue起來..恩....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Command Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 被Queue起來的Command會被照順序處理..恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩...恩恩..是會變成那樣沒錯....
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 就算是任性的client的請求也得照順序處理.恩.
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ;∀;)  ∧ ∧ < 那種事...那種事..
 (  ⊃ )  (;Д;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

         /
  ∧ ∧ < 兩個人都別哭了..
  (    ) ╲_____________
∼(___ノ  旦

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_Command.html


reply to postreply to post
作者 Part18 [DP] Composite Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2004-03-29 20:17 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part18 [DP]CompositePattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 這樣就可以將容器跟內容一視同仁..恩....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Composite Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 複數跟單數都可以等同視之..恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩...恩恩..是可以那樣說....
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 公寓跟獨棟都馬一樣.恩.
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 我又沒說..
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

         /
  ∧ ∧ < 某方面來說..我想他說中了..
  (    ) ╲_____________
∼(___ノ  旦

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_Composite.html


koji edited on 2004-03-29 21:25
reply to postreply to post
作者 Part19 [DP] Decorator Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2004-03-29 20:21 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part19 [DP] Decorator Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < java.io.FilterReader是個典型的例子..恩....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Decorator Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 將ConcreteDecorator重疊起來達到所要的目的..恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩...恩恩..沒錯....
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 亂做一堆細微的類別的人就是你.恩.
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 不..不是我..!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_Decorator.html


reply to postreply to post
作者 Part20 [DP] Interpreter Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2004-03-29 20:26 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part20 [DP] Interpreter Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 首先先使用擴張BNF來寫一下..恩....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是 Interpreter Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 為了解決問題,製作新的語言..恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩...但是文法很簡單....
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 然後瞄準Java語言的下一個龍頭.恩.
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 怎麼可能阿..!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

         /
  ∧ ∧ < c#是吧.
  (    ) ╲_____________
∼(___ノ  旦

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_Interpreter.html


reply to postreply to post
作者 Part21 [DP] Mediator Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2004-03-29 20:37 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part21 [DP] Mediator Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 將判斷邏輯集中在Mediator..恩....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Mediator Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| Colleague會委讓給Mediator去判斷..恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩...恩恩..是這樣沒錯....
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 你也要像Mediator一樣可以信賴....是吧..恩.
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 我又沒說..!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Mediator小學1年GoF班

          ___________________
          ||          。   Λ_Λ 「有什麼不懂的要跟老師說喔」
          ||          ╲ (゚д゚ )
          ||___ _____⊂⊂ | ConcreteMediator老師
  ∧ ∧    ∧ ∧    ∧ ∧    |____|___
  (  ∧ ∧ (   ∧ ∧ (  ∧ ∧ |      |
∼(_(  ∧ ∧ __(  ∧ ∧__(   ∧ ∧____|
  ∼(_(  ∧ ∧_(  ∧ ∧_(   ∧ ∧  「好的~」
    ∼(_(   ,,)∼(_(   ,,)∼(_(   ,,)
      ∼(___ノ  ∼(___ノ   ∼(___ノ ConcreteColleague的好孩子們

from http://www.hyuki.com/dp/cat_Mediator.html


reply to postreply to post
作者 Part22 [DP] Memento Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2004-03-29 20:47 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part22 [DP] Memento Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 而且不會發生封裝化破壞..恩....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Memento Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 只把有限的method設為public..恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩恩..只有narrow interface而已....
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 也就是說不能跟你說秘密.恩.
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 我又沒說..!!
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

         /
  ∧ ∧ < 秘密就跟friend說吧..
  (    ) ╲_____________
∼(___ノ  旦

         /
  ∧ ∧ < 但是Java沒有friend..
  (,,・∀・) ╲_____________
∼(___ノ  旦

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
封裝化!?
    啪噹 !!
 _______ ミ  Λ_Λ  _______
 |  ╲      ╲ (・∀・ )< 封裝化完成♪
 |   |::::::::::::::|⊂    ) ╲_______
 |   |:      .:| | | |
 |   |:      .:|(_(__)

  ______
 /......  .. ...../
 ||:::::::∧ ∧ |  ________ Λ_Λ  ________
 |__ ( ;゚Д゚) < 我出不來阿!   (・∀・ ;;)< 看來不是只有設成private就好…
 |   |::::::::::::::|╲______.⊂    ) ╲_______
 |   |:      .:|            | | |
 |   |:      .:|           (_(__)

from http://www.hyuki.com/dp/cat_Memento.html


koji edited on 2004-03-29 21:26
reply to postreply to post
作者 Part23 [DP] Observer Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2004-03-29 20:55 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part23 [DP] Observer Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < Subject的狀態變化會被通知..恩....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Observer Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 一個subject同時有多個Observer在監視..恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩...恩恩..通常來說Observer都是複數....
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 也就是說時常都是全世界的笑柄.恩.
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 只會通知有註冊的Observer啦..
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

         /
  ∧ ∧ < 明明等著被通知,怎麼說成"監視"..?
  (    ) ╲_____________
∼(___ノ  旦

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_Observer.html


reply to postreply to post
作者 Part24 [DP] Prototype Pattern [Re:koji]
koji

秒速5センチメートル

站長

發文: 8415
積分: 19
於 2004-03-29 21:07 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Part24 [DP] Prototype Pattern

∧_∧  敲敲敲  ╱
(    )  ∧ ∧ < 等於是說利用來copy&paste製作實體..恩....。
(    )  (,,゚Д゚)  ╲____________
______ (つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
____________

| 喔~、是Prototype Pattern嗎?
╲ __ __________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 你你是誰?...有..有什麼事嬤你?・・・
  (  ⊃ )  (゚Д゚;)  ╲____________
________(つ_つ____
|    日∇ ╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 利用實體來製作實體..恩
╲ __ ________
  |╱
  ∧_∧       ╱
  ( ・∀・)  ∧ ∧ < 恩..可以那樣說...類別變成配角.
 (     )  (;゚Д゚)  ╲____________
_____ (つ_つ____
|     日∇╲|ThinkPad|╲
|       =========  ╲

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__________

| 把類別的設計失敗,在實體修正.恩.
╲ __ ________
  |╱
 ∧_∧       ╱
 ( ・∀・)  ∧ ∧ < 不..不是這樣拉..
 (  ⊃ )  (゚Д゚;) ╲____________
_____(つ_つ____
|   日∇ ╲|ThinkPad|╲
|      =========  ╲
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
giko.clone()

    ∧ ∧        ┌────────────────
   ( ゚Д゚ )       < giko.clone()
    U  U        └────────────────
     |  |
    U U

    ∧ ∧ ∧      ┌────────────────
   ( ゚Д ゚Д゚ )     < 這這是、
    U  U  U      .└────────────────
     |    |
    U U U

    ∧ ∧∧∧     ┌────────────────
   ( ゚Д゚ ゚Д゚ )    < 到底到底是、
    U U.U  U     └────────────────
     |     |
    .U UU U

    ∧ ∧   ∧ ∧   ┌────────────────
   ( ゚Д゚ >< ゚Д゚ )  < 是shallow copy是shallow copy嗎
    U  U  U  U   └────────────────
     |   ><  |
    .U U   U U

.    ∧ ∧   ∧ ∧  ┌────────────────
    ( ゚Д゚ ) * ( ゚Д゚ ) < 或是deep copy。或是 deep copy。
    U  U   U  U  └────────────────
     |  .| .* |  |
     U U   .U U- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

from http://www.hyuki.com/dp/cat_Prototype.html


koji edited on 2004-03-29 21:15
reply to postreply to post
» JWorld@TW »  Software Design

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8