Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
OO training homework 1 review and summary
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
hatelove
July 20, 2012
Technology
1
8.1k
OO training homework 1 review and summary
將大家 homework 1 需注意的地方,延伸思考的部分提出來。
hatelove
July 20, 2012
Tweet
Share
More Decks by hatelove
See All by hatelove
1. 在沙箱中開發
hatelove
12
3k
BDD in .NET - TDD 在實務上的最後一塊拼圖
hatelove
4
2.9k
OO training 基本原則整理
hatelove
2
5.3k
OO training homework 3 review and summary
hatelove
1
11k
OO training homework 2 review and summary
hatelove
1
4.6k
Object Oriented Training - Session 4
hatelove
1
5.2k
Object Oriented Training - Session 3
hatelove
1
11k
Object Oriented Training - Session 2
hatelove
1
4.8k
Object Oriented Training - Session 1
hatelove
1
8.4k
Other Decks in Technology
See All in Technology
DDD×仕様駆動で回す高品質開発のプロセス設計
littlehands
5
2.3k
JEDAI認定プログラム JEDAI Order 2026 受賞者一覧 / JEDAI Order 2026 Winners
databricksjapan
0
270
【社内勉強会】新年度からコーディングエージェントを使いこなす - 構造と制約で引き出すClaude Codeの実践知
nwiizo
20
11k
Navigation APIと見るSvelteKitのWeb標準志向
yamanoku
2
110
Phase08_クイックウィン実装
overflowinc
0
1.6k
Agent Skill 是什麼?對軟體產業帶來的變化
appleboy
0
220
Phase07_実務適用
overflowinc
0
1.7k
AI時代のオンプレ-クラウドキャリアチェンジ考
yuu0w0yuu
0
210
スピンアウト講座06_認証系(API-OAuth-MCP)入門
overflowinc
0
1k
ADK + Gemini Enterprise で 外部 API 連携エージェント作るなら OAuth の仕組みを理解しておこう
kaz1437
0
170
データマネジメント戦略Night - 4社のリアルを語る会
ktatsuya
1
200
20260320_JaSST26_Tokyo_登壇資料.pdf
mura_shin
0
120
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
Producing Creativity
orderedlist
PRO
348
40k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
68
38k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.2k
Balancing Empowerment & Direction
lara
5
960
A Modern Web Designer's Workflow
chriscoyier
698
190k
Automating Front-end Workflow
addyosmani
1370
200k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
770
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
180
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
650
Transcript
Date: 2012/05/21 OO training – homework 1 review
作業整理摘要
- 3 - 物件職責 • 將商品資訊聚合成為Entity • 把new Class的動作,與使用Class的動作隔開 •
物流商是否具有長、寬、高、重點等商品屬性 • 商品上是否應該擁有計算運費的方法 • 物流商的名稱,是否可由外部設定
- 4 - 重構 • 重構應確保重構後的結果,與重構前相同 – 工具 • Selenium
• 單元測試 – 例子 • 物流商配置顛倒 • double改成float或int • 衍生設計 • Visual Studio重構功能 – 擷取方法 – 擷取介面 – 封裝欄位
- 5 - DRY • 判斷式中,重複出現相同的程式碼,是否可以移出判斷式之 外 • 子類與父類相同的部份,是否只需放在父類 •
抽象來看,是否相同,不同的地方在哪
- 6 - 建議 • 每個Class獨立一個檔案 • 預設的todo註解請記得清除 – 工作清單視窗
- 7 - 衍生需求 • 當每間物流商計算運費所需要的商品資訊增加時,該如何修 改程式 • 低溫冷藏時,計算運費的方式不同 •
頁面新需求為,選擇最便宜的物流商,並呈現運費結果
- 8 - 課程補充 • new與override • overload
- 9 - Step • 把計算運費抽出來,成為BL – abstract – interface
• 把new class與使用class隔開 – function – Factory class • 把商品資訊定義成Entity • 抽象工廠 • 物流商名稱使用Enum Description
Q & A