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
hatelove
July 20, 2012
Technology
1
8k
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.8k
OO training 基本原則整理
hatelove
2
5.2k
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.1k
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.3k
Other Decks in Technology
See All in Technology
AWS環境のリソース調査を Claude Code で効率化 / aws investigate with cc devio2025
masahirokawahara
2
1.4k
Kiroと学ぶコンテキストエンジニアリング
oikon48
6
9.5k
オブザーバビリティが広げる AIOps の世界 / The World of AIOps Expanded by Observability
aoto
PRO
0
320
MCPで変わる Amebaデザインシステム「Spindle」の開発
spindle
PRO
3
3k
ガチな登山用デバイスからこんにちは
halka
1
230
COVESA VSSによる車両データモデルの標準化とAWS IoT FleetWiseの活用
osawa
1
220
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
8.7k
250905 大吉祥寺.pm 2025 前夜祭 「プログラミングに出会って20年、『今』が1番楽しい」
msykd
PRO
1
560
Automating Web Accessibility Testing with AI Agents
maminami373
0
1.1k
Obsidian応用活用術
onikun94
1
420
品質視点から考える組織デザイン/Organizational Design from Quality
mii3king
0
150
Autonomous Database - Dedicated 技術詳細 / adb-d_technical_detail_jp
oracle4engineer
PRO
4
10k
Featured
See All Featured
Balancing Empowerment & Direction
lara
3
610
How to Think Like a Performance Engineer
csswizardry
26
1.9k
Building Applications with DynamoDB
mza
96
6.6k
Navigating Team Friction
lara
189
15k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
111
20k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
51
5.6k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
A Modern Web Designer's Workflow
chriscoyier
696
190k
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