Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
OO training homework 2 review and summary
Search
hatelove
July 23, 2012
Technology
4.7k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
OO training homework 2 review and summary
將大家 homework 2 需注意的地方,延伸思考的部分提出來
hatelove
July 23, 2012
More Decks by hatelove
See All by hatelove
1. 在沙箱中開發
hatelove
12
3.1k
BDD in .NET - TDD 在實務上的最後一塊拼圖
hatelove
4
3k
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.9k
Object Oriented Training - Session 1
hatelove
1
8.4k
Other Decks in Technology
See All in Technology
GitHub Agentic Workflows を触ってみる
htkym
2
880
Azure Copilot Resiliency Agentをいろいろ試してみる
tomokusaba
0
140
スキルを作る、その前に!複数人で使われるスキルを 作るためのプロセス
junkifurukawa
0
100
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
16
120k
雪かき部 #7 もう怖くない!SELECT文!
foursue
0
220
カンファレンスに参加した後の浮遊感とセルフケア
pauli
0
240
個別開発で終わらせない。 現場の課題をプロダクトの強さに変える StockmarkのFDE
ktkrhr
0
430
3人で1000GPU超を統合運用する?マルチクラウド&オンプレを跨ぐ、構築と運用のリアル!
kazukun0716
2
770
CI/CDではもう遅い - 人とAIが迂回しないDevSecOps Verify基盤の再設計 -
kintotechdev
1
450
メルカリにおけるAI時代の高速プロトタイピング基盤「Arca」
ryotarai
18
13k
HolmesGPTで始めるSREエージェント入門!プラットフォームの障害調査はAIにお任せ 〜
sanghyuk
0
250
TiDBファミリーにDWHが新登場!! TiDB最新情報 / TiDB update 202609
yoshiakiyamasaki
0
160
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
187
23k
We Are The Robots
honzajavorek
0
380
Agile that works and the tools we love
rasmusluckow
331
22k
Code Review Best Practice
trishagee
74
20k
Technical Leadership for Architectural Decision Making
baasie
3
580
Statistics for Hackers
jakevdp
799
230k
Tell your own story through comics
letsgokoyo
1
1.1k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
530
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
750
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
For a Future-Friendly Web
brad_frost
183
10k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
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