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 2 review and summary
Search
hatelove
July 23, 2012
Technology
1
4.6k
OO training homework 2 review and summary
將大家 homework 2 需注意的地方,延伸思考的部分提出來
hatelove
July 23, 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 1 review and summary
hatelove
1
8.1k
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
これまでのネットワーク運用を変えるかもしれないアプデをおさらい
hatahata021
4
230
Java 25に至る道
skrb
3
230
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
Data Hubグループ 紹介資料
sansan33
PRO
0
2.6k
Security Hub と出会ってから 1年半が過ぎました
rch850
0
160
AIAgentを駆使してSREが貢献する開発体験の向上
yoshiiryo1
1
260
AI アクセラレータチップ AWS Trainium/Inferentia に 今こそ入門
yoshimi0227
1
280
Kusakabe_面白いダッシュボードの表現方法
ykka
0
350
国井さんにPurview の話を聞く会
sophiakunii
1
450
AI Agent Standards and Protocols: a Walkthrough of MCP, A2A, and more...
glaforge
0
420
Eight Engineering Unit 紹介資料
sansan33
PRO
0
6.3k
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
3
960
Featured
See All Featured
Optimizing for Happiness
mojombo
379
71k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
From π to Pie charts
rasagy
0
120
How STYLIGHT went responsive
nonsquared
100
6k
[SF Ruby Conf 2025] Rails X
palkan
0
710
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
57
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
It's Worth the Effort
3n
188
29k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
52k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
220
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
41
Transcript
Date: 2012/06/04 OO training – homework 2 review
- 2 - 延伸思考 • 增加了非Manager,但會code review的角色 – 如:資深工程師、顧問 •
增加了不會code review的Manager – 如:HR manager • 每個manager的CodeReview方式不同
- 3 - 整理 • 職責 – Program屬於場景 – Builder,
Factory屬於工廠 • 命名 – Pascal & camel – GetsXXX or SetsXXX • Magic number or magic string – hard-code的字串或數字(非0 or 1) – Extract to member/field/property with readonly • readonly & constant – Enum, config, database or resource
- 4 - 效能 • 比較字串 – a.ToUpper() == “Y”
– string.Compare(a, “y”, true) ==0 • 宣告為virtual • 透過try/catch攔exception,控制流程
- 5 - 用法 • parameter建議不要複雜化 – 三元判斷式 – Function
• Console.WriteLine() – (string format, params object[] arg) – boxing • DRY – 多型 – 判斷式執行子句,只放因為條件不同而不同的部分 • 避免使用預設存取修飾詞
- 6 - 設計 • 存取修飾詞 – public: 從外部看這個物件的觀點 –
protected: 從子類看父類的觀點 – private: 從物件本身看自己的觀點 • 設計為virtual時,考慮是否應為abstract • 使用的角度 – interface • 物件的本質與共通性 – abstract • 系統的抽象程度看interface,重用程度看abstract
- 7 - 其他 • 不同題作業,請分不同project。可共用同一個solution。 • 請確認可以建置通過與執行無誤
Q & A