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
三菱UFJ銀行におけるエンタープライズAI駆動開発のリアル / Enterprise AI_Driven Development at MUFG Bank: The Real Story
muit
11
20k
Claude Cowork Plugins を読む - Skills駆動型業務エージェント設計の実像と構造
knishioka
0
250
EMからICへ、二周目人材としてAI全振りのプロダクト開発で見つけた武器
yug1224
3
200
Eight Engineering Unit 紹介資料
sansan33
PRO
1
6.9k
開発組織の課題解決を加速するための権限委譲 -する側、される側としての向き合い方-
daitasu
3
180
作るべきものと向き合う - ecspresso 8年間の開発史から学ぶ技術選定 / 技術選定con findy 2026
fujiwara3
7
2k
「ヒットする」+「近い」を同時にかなえるスマートサジェストの作り方.pdf
nakasho
0
100
Webアクセシビリティ技術と実装の実際
tomokusaba
0
210
Serverless Agent Architecture on Azure / serverless-agent-on-azure
miyake
1
130
自動テストが巻き起こした開発プロセス・チームの変化 / Impact of Automated Testing on Development Cycles and Team Dynamics
codmoninc
1
980
JAWS DAYS 2026 CDP道場 事前説明会 / JAWS DAYS 2026 CDP Dojo briefing document
naospon
0
120
生成AI活用によるPRレビュー改善の歩み
lycorptech_jp
PRO
5
2k
Featured
See All Featured
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
310
SEO for Brand Visibility & Recognition
aleyda
0
4.3k
Writing Fast Ruby
sferik
630
62k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Test your architecture with Archunit
thirion
1
2.2k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
290
Designing for humans not robots
tammielis
254
26k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
140
Scaling GitHub
holman
464
140k
30 Presentation Tips
portentint
PRO
1
250
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
470
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