有冇幾款常用/易學既design pattern介紹

本帖最後由 mingming123 於 2017-4-6 17:35 編輯

我好鍾意睇design pattern,  但係成日記唔住同用唔番出黎
好似用過pipeline pattern,  同command pattern
via HKEPC Reader for Android

MVC?
Singleton?

TOP

回復 2 #KinChungE

都算呀

via HKEPC Reader for Android

TOP

strategy, factory, builder, observer

TOP

成本 Gang of Four 哽晒佢. 唔好揀 (你問得呢個問題,即係未夠經驗去揀 :p )

再黎唱一唱反調...

除左超大路O既  iterator / factory / observer / strategy / template pattern, 其他野真係唔好太在意, 尤其係剛開始. 見過好多人/system 本末倒置, "我一定要用 XXX pattern去做", 成套system 反而變得唔自然.
design pattern 應該係自然而然咁浮現出黎. "咦, 呢個咪好似 visitor lor", 跟住你再跟住個 pattern 去 rename 下啲class, 執執佢等後人易睇D

TOP

我好鍾意睇design pattern,  但係成日記唔住同用唔番出黎
好似用過pipeline pattern,  同command pattern
v ...
mingming123 發表於 2017-4-6 17:15



http://www.dofactory.com/net/design-patterns

你好似寫開.NET... 上面條link應該啱你..

TOP

我好鍾意睇design pattern,  但係成日記唔住同用唔番出黎
好似用過pipeline pattern,  同command pattern
v ...
mingming123 發表於 2017-4-6 17:15


正常, design pattern無人會記得晒...除非做教書日日教
一般黎講
Refactoring 睇一次就唔洗書
Design Pattern就你買定本書收藏啦

TOP

仲有一樣野:
Design Pattern係代表一個problem千除百煉後既solution
基本上你睇唔到個Solution中間既演化過程....
即係好似叫你直接背公式而唔教你中間既推導過程....難記好多

有一本書將Refactoring同Design Pattern中間既gap位填補, 叫"Refactoring to Pattern" 有興趣去睇下, 如何將code改善做pattern, 又如何將overengineering既pattern返拆散

TOP

仲有一樣野:
Design Pattern係代表一個problem千除百煉後既solution
基本上你睇唔到個Solution中間既演化 ...
wfu2009 發表於 2017-4-17 23:16



    其實martin fowler/gang of four/eric evans啲書都要睇哂,好多cross-reference

TOP

It really depends on project.  Just use one you feel right.  But be flexible and prepare to change course.

TOP

相關文章