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
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
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
【公開用】AI_Dev_Ex2026_AI_登壇資料
matsuritechnologies
PRO
1
450
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
110k
現場との対話から始める “作る前に問い直す”業務改善
mochico50
1
190
10年目を迎えた「ABEMA」がどのように AI 活用を推進して、AI 駆動開発にシフトしているのか / How ABEMA, entering its 10th year, is promoting the use of AI and shifting toward AI-driven development
miyukki
0
360
第67回コンピュータビジョン勉強会CVPR2026読会前編
tsukamotokenji
0
160
41歳でAWSが好きすぎてITエンジニアになったおっさんの話
yama3133
1
730
AIが当たり前の組織で エンジニアはどう育つか
nishihira
1
920
CDKで書くECSのベストプラクティス、 改めて考え直す2026 #cdkconf2026
makies
3
930
非定型なドキュメントを効率よくリファクタする 〜えぇ!?仕様書27本の移行が1日で終わったって!?〜
subroh0508
2
600
探索・可視化・自動化を一本化 Amazon Quickでデータ活用スピードを上げる方法
koheiyoshikawa
0
170
AI Coding Agent時代のcdk-nagガードレール 〜組織ルールを強制CIで守り抜く設計の挑戦〜
mhrtech
3
490
“それは自分の仕事じゃない"を越えて行け
yuukiyo
1
520
Featured
See All Featured
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
220
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
350
The browser strikes back
jonoalderson
0
1.4k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
220
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
660
Designing for humans not robots
tammielis
254
26k
Mobile First: as difficult as doing things right
swwweet
225
10k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
240
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