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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
hatelove
July 23, 2012
Technology
4.6k
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
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.9k
Object Oriented Training - Session 1
hatelove
1
8.4k
Other Decks in Technology
See All in Technology
失敗を資産に変えるClaude Code
shinyasaita
0
380
AmazonRoute 53ではじめてのドメイン取得!HTTPS化までの道のりを整理してみた
usanchuu
3
130
機械学習を「社会実装」するということ 2026年夏版 / Social Implementation of Machine Learning June 2026 Version
moepy_stats
4
1.5k
新しいVibe Codingと”自走”について
watany
5
290
ポケモンの型をTypeScriptの型システムで表現してみた
subroh0508
0
370
Bucharest Tech Week 2026 - Reinventing testing practices in the AI era
edeandrea
PRO
1
140
LLMにもCAP定理があるという話
harukasakihara
0
290
失敗を経て、Harness Engineering で 大切にしたいことを考える / Learning from Failure: What Matters in Harness Engineering
bitkey
PRO
1
300
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.9k
ACE-Step-1.5で見る 音楽生成AIのしくみと“破綻だけ直す”Retake機能の開発【zennfes spring 2026 登壇資料】
personabb
1
120
RSA暗号を手計算したくなること、ありますよね?? (20260615_orestudy6_rsa)
thousanda
0
220
小さく始める AI 活用推進 ― 日経電子版 Web チームの事例/nikkei-tech-talk47
nikkei_engineer_recruiting
0
220
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
380
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
300
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Skip the Path - Find Your Career Trail
mkilby
1
140
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
280
Heart Work Chapter 1 - Part 1
lfama
PRO
7
36k
From π to Pie charts
rasagy
0
210
30 Presentation Tips
portentint
PRO
1
320
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
400
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
130
Believing is Seeing
oripsolob
1
140
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
580
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