Soumettre la recherche
Mettre en ligne
Strategy Pattern
•
Télécharger en tant que PPTX, PDF
•
0 j'aime
•
333 vues
Ted Liang
Suivre
Design pattern, Strategy
Lire moins
Lire la suite
Logiciels
Signaler
Partager
Signaler
Partager
1 sur 18
Télécharger maintenant
Recommandé
about android gradle and flavor
Android Gradle about using flavor
Android Gradle about using flavor
Ted Liang
Coscup Ruby track 客戶和 pm 開的功能完全不知道如何是好? 當工程師後怎麼程式碼跟 Rails CRUD 完全不一樣? 找不到前手的 legacy code 該如何處理? 公司的 senior 介於有跟沒有之間,該怎麼進步? 發現自己幾個月前的東西很難改,難道是現世報? 講者將彙整自己從 Junior 到稍微沒那麼 Junior 以及匯集身邊朋友的經驗,提供要跨出 Ruby or Rails 新手村的夥伴一些實用的建議!
我要活下來 - Ruby Junior 工程師的存活術
我要活下來 - Ruby Junior 工程師的存活術
Li Hsuan Hung
This slide presents some famous architectures and how to use DDD to implement system and choose which architecture is more appropriate.
DDD架構設計
DDD架構設計
國昭 張
從 Scrum 到 Kanban: 為什麼 Scrum 不適合 Lean Startup
從 Scrum 到 Kanban: 為什麼 Scrum 不適合 Lean Startup
Wen-Tien Chang
規劃求解工作坊 Solver Workshop 運用多種網上平台推行事工 Employing Multiple Online Platforms for Missions Calvin Yu @ CCL / 2010.06.12 這個簡報以「反思對談式的兒童事工」為基礎,介紹整個運用多種網上平台推行事工具體方案的思考過程,希望讓證主的同工不單能瞭解選取相關工具的原因,更重要的是跟同工分享當中的思考過程和制訂策略的原則,希望能令同工在考慮其他的事工方案時也能運用。 This presentation introduces the solution of employing multiple online platforms for a particular mission of CCL as well as the underlying thinking process. I hope the sharing can not only let CCL colleagues understand the reason for the tool selection, but also the strategic thinking process and principles so that they can employ the same methodology in the preparation for other missions.
Solver Workshop 規劃求解工作坊 (2010.06.12 @ CCL)
Solver Workshop 規劃求解工作坊 (2010.06.12 @ CCL)
Calvin C. Yu
A view of Agile form a vendor project manager.
從乙方PM的角度看敏捷
從乙方PM的角度看敏捷
KC Liu
Clean Code 讀書心得分享 https://kylinyu.win/php_best_practice
無瑕的程式碼 Clean Code 心得分享
無瑕的程式碼 Clean Code 心得分享
Win Yu
在 DevOps 文化越來越流行的當下,我們該如何透過 DevOps 的精神來幫助 Open Source 的 Project 進行,從需求著手,了解 Open Source Project 使用者使用後的 Feedback,加上自動化工具的幫助,持續進行完成對使用者更加友善的 Open Source Project。
Open source的devops工具箱 公開版@coscup2016
Open source的devops工具箱 公開版@coscup2016
Kirk Chen
Recommandé
about android gradle and flavor
Android Gradle about using flavor
Android Gradle about using flavor
Ted Liang
Coscup Ruby track 客戶和 pm 開的功能完全不知道如何是好? 當工程師後怎麼程式碼跟 Rails CRUD 完全不一樣? 找不到前手的 legacy code 該如何處理? 公司的 senior 介於有跟沒有之間,該怎麼進步? 發現自己幾個月前的東西很難改,難道是現世報? 講者將彙整自己從 Junior 到稍微沒那麼 Junior 以及匯集身邊朋友的經驗,提供要跨出 Ruby or Rails 新手村的夥伴一些實用的建議!
我要活下來 - Ruby Junior 工程師的存活術
我要活下來 - Ruby Junior 工程師的存活術
Li Hsuan Hung
This slide presents some famous architectures and how to use DDD to implement system and choose which architecture is more appropriate.
DDD架構設計
DDD架構設計
國昭 張
從 Scrum 到 Kanban: 為什麼 Scrum 不適合 Lean Startup
從 Scrum 到 Kanban: 為什麼 Scrum 不適合 Lean Startup
Wen-Tien Chang
規劃求解工作坊 Solver Workshop 運用多種網上平台推行事工 Employing Multiple Online Platforms for Missions Calvin Yu @ CCL / 2010.06.12 這個簡報以「反思對談式的兒童事工」為基礎,介紹整個運用多種網上平台推行事工具體方案的思考過程,希望讓證主的同工不單能瞭解選取相關工具的原因,更重要的是跟同工分享當中的思考過程和制訂策略的原則,希望能令同工在考慮其他的事工方案時也能運用。 This presentation introduces the solution of employing multiple online platforms for a particular mission of CCL as well as the underlying thinking process. I hope the sharing can not only let CCL colleagues understand the reason for the tool selection, but also the strategic thinking process and principles so that they can employ the same methodology in the preparation for other missions.
Solver Workshop 規劃求解工作坊 (2010.06.12 @ CCL)
Solver Workshop 規劃求解工作坊 (2010.06.12 @ CCL)
Calvin C. Yu
A view of Agile form a vendor project manager.
從乙方PM的角度看敏捷
從乙方PM的角度看敏捷
KC Liu
Clean Code 讀書心得分享 https://kylinyu.win/php_best_practice
無瑕的程式碼 Clean Code 心得分享
無瑕的程式碼 Clean Code 心得分享
Win Yu
在 DevOps 文化越來越流行的當下,我們該如何透過 DevOps 的精神來幫助 Open Source 的 Project 進行,從需求著手,了解 Open Source Project 使用者使用後的 Feedback,加上自動化工具的幫助,持續進行完成對使用者更加友善的 Open Source Project。
Open source的devops工具箱 公開版@coscup2016
Open source的devops工具箱 公開版@coscup2016
Kirk Chen
googleplayservice 7.8 & andorid M tech
google play service 7.8 & new tech in M
google play service 7.8 & new tech in M
Ted Liang
introduce google io 2015 about android
what new in google io 2015
what new in google io 2015
Ted Liang
a small talk about activity transition. 說明要如何一步步完成我們的activity transition.
Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)
Ted Liang
a small talk about activity transition
Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)
Ted Liang
無標題簡報
無標題簡報
Ted Liang
about using android third party library Dagger, Rxjava, Retrofit
Dagger & rxjava & retrofit
Dagger & rxjava & retrofit
Ted Liang
Adapter Pattern
Adapter Pattern
Adapter Pattern
Ted Liang
設計模式的解析與活用 -開拓視野
設計模式的解析與活用 -開拓視野
設計模式的解析與活用 -開拓視野
Ted Liang
Design pattern intro
Design pattern intro
Ted Liang
物件導向範型
物件導向範型
Ted Liang
Git簡報
Git簡報
Ted Liang
Contenu connexe
Plus de Ted Liang
googleplayservice 7.8 & andorid M tech
google play service 7.8 & new tech in M
google play service 7.8 & new tech in M
Ted Liang
introduce google io 2015 about android
what new in google io 2015
what new in google io 2015
Ted Liang
a small talk about activity transition. 說明要如何一步步完成我們的activity transition.
Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)
Ted Liang
a small talk about activity transition
Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)
Ted Liang
無標題簡報
無標題簡報
Ted Liang
about using android third party library Dagger, Rxjava, Retrofit
Dagger & rxjava & retrofit
Dagger & rxjava & retrofit
Ted Liang
Adapter Pattern
Adapter Pattern
Adapter Pattern
Ted Liang
設計模式的解析與活用 -開拓視野
設計模式的解析與活用 -開拓視野
設計模式的解析與活用 -開拓視野
Ted Liang
Design pattern intro
Design pattern intro
Ted Liang
物件導向範型
物件導向範型
Ted Liang
Git簡報
Git簡報
Ted Liang
Plus de Ted Liang
(11)
google play service 7.8 & new tech in M
google play service 7.8 & new tech in M
what new in google io 2015
what new in google io 2015
Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)
Android Activity Transition(ShareElement)
無標題簡報
無標題簡報
Dagger & rxjava & retrofit
Dagger & rxjava & retrofit
Adapter Pattern
Adapter Pattern
設計模式的解析與活用 -開拓視野
設計模式的解析與活用 -開拓視野
Design pattern intro
Design pattern intro
物件導向範型
物件導向範型
Git簡報
Git簡報
Strategy Pattern
1.
Strategy Ted
2.
• 考慮變化的設計 – 針對介面設計程式而不要針對時做來設計程式 –
優先使用聚合,而不是類別繼承 – 考慮設計中甚麼是可變的,在變化發生時不需 重新設計
3.
國際電子商務的例子
4.
• Switch Creep
5.
• 難以閱讀 • 難以理解 •
很容易有遺漏
6.
• 使用繼承的方式解決? • 看起來不錯?
7.
新的需求… • 貨運服務 • 國外可能沒有黑貓宅配或超商取貨
8.
What can we
do? • Override Rule的method,使他不做任何事 • 這樣做真的對嗎?
9.
• 而且這樣做會造成冗餘的程式碼,假設加 拿大跟日本的貨運是使用同樣的方式,但 是我們並無法將程式碼寫在同一個地方(使 用override),即使可以也會造成弱內聚(使 用Switch)
10.
11.
是否有其他的做法 • 想想開頭說的考慮變化的設計 – 尋找變化並封裝他 –
將這個類別包含在另一個類別中
12.
• 解決了冗餘的程式碼也不需使用switch來判 斷要使用哪個rule
13.
• 意圖:可以根據所處上下文使用不同的規則 或演算法 • 問題:隊所需演算法的選擇取決於發出請求 的對象 •
解決方案:將對演算法的選擇和實作分離
14.
• 參與者與協作者 – Strategy指定了如何使用不同的演算法 –
利用各ConcreteStrategy實作 – Main 透過type選擇使用的演算法(多型) • Strategy = new FirstStrategy() • Strategy = new SecondStrategy()
15.
• 效果 – Strategy定義了一系列的演算法 –
可不使用Switch – 必須使用同樣介面呼叫演算法 • 實作 – Sample code
16.
實作經驗 • 在使用getTax的範例中,英國某個年齡層的 人並不需付食物消費稅。 • 如何解決這個問題
17.
• 將customer物件傳給rule物件 • 將customer的成員傳給rule物件 •
將this傳給rule物件 • 即使需要修改,但是我們還是可預期修改 幅度不致於太大,而且不太可能引入新問 題
18.
• 封裝邏輯 • 簡化測試
Télécharger maintenant