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.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.9k
Object Oriented Training - Session 1
hatelove
1
8.4k
Other Decks in Technology
See All in Technology
JSAI2026 オーガナイズドセッションOS-27「不動産とAI」趣旨説明 / JSAI2026 Organized Session OS-27 “Real Estate and AI”: Statement of Purpose
ykiyota
0
230
日本 Fintech 未来予測レポート 2027〜2028年(手動編集版)
8maki
0
1.8k
Microsoft Build Keynoteふりかえり
tomokusaba
0
120
Claude Code×Terraform IaC テンプレート駆動開発
itouhi
1
490
AI-DLCを活用した高品質・安全なAI駆動開発実践 / AI Driven Development with AI-DLC
yoshidashingo
0
170
AGENTS.mdとSkillsで始めるAIエージェント活用
sonoda_mj
2
190
AIソロプレナー時代に2ヶ月で20人増員した事業創造会社の開発組織の話
miyatakoji
0
590
なぜ Platform Engineering の土台に Kubernetes を選ぶのか
r4ynode
1
580
タクシーアプリ『GO』の実践的データ活用
mot_techtalk
3
190
On-behalf-of Token exchange with AgentCore Identity
hironobuiga
2
150
現地で盛り上がった WWDC26 Keynote
zozotech
PRO
1
200
2026.06.13_AI時代に事業会社が「SIer出身エンジニア」を求める理由 / Why Businesses Seek Engineers with a System Integrator Background in the AI Era
jumtech
0
1k
Featured
See All Featured
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
160
Building Applications with DynamoDB
mza
96
7.1k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
330
Tell your own story through comics
letsgokoyo
1
950
Thoughts on Productivity
jonyablonski
76
5.2k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
480
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
730
RailsConf 2023
tenderlove
30
1.5k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
220
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
300
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
720
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
770
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