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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
hatelove
July 20, 2012
Technology
8.1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
OO training homework 1 review and summary
將大家 homework 1 需注意的地方,延伸思考的部分提出來。
hatelove
July 20, 2012
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.7k
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.9k
Object Oriented Training - Session 1
hatelove
1
8.4k
Other Decks in Technology
See All in Technology
SRE依存からの脱却 運用を開 発チームへ移す、 フルサイ クル開 発体制の実践
joooee0000
0
2.9k
[2026-07-15] AI Ready なはずだったアーキテクチャと、見えてきた課題・次に目指す状態
wxyzzz
9
3.9k
10年目を迎えた「ABEMA」がどのように AI 活用を推進して、AI 駆動開発にシフトしているのか / How ABEMA, entering its 10th year, is promoting the use of AI and shifting toward AI-driven development
miyukki
0
220
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
110k
Amplify Gen2でbackend.tsにCDKを定義する/しない事によるCDKの挙動の違いとユースケース
smt7174
1
350
ヘルスケア領域における AI 活用と その安全性担保のための取り組み (Leveraging AI in Healthcare and Our Efforts to Ensure Its Safety) - Google I/O Extended Tokyo 2026, July 11, 2026
zettaittenani
0
410
世界、断片、モデル。そして理解
ardbeg1958
1
130
しくみを学んで使いこなそう GitHub Copilot app
torumakabe
2
280
DMM.com 購入改善推進チーム におけるCodeRabbitを用いた レビューフロー改善の一例
ysknsid25
2
650
AI時代のYAGNI:「爆速で無駄になった機能」からの学び / 20260720 Naoki Takahashi
shift_evolve
PRO
2
250
Compose 新機能総まとめ / What's New in Jetpack Compose
yanzm
0
300
壊して学ぶAWS CDK: そのcdk deployで消えるもの、残るもの
k_adachi_01
1
330
Featured
See All Featured
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Accessibility Awareness
sabderemane
1
150
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Designing for Performance
lara
611
70k
How GitHub (no longer) Works
holman
316
150k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
We Are The Robots
honzajavorek
0
280
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
720
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
260
Writing Fast Ruby
sferik
630
63k
Side Projects
sachag
455
43k
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