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 3 review and summary
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
hatelove
July 24, 2012
Technology
1
11k
OO training homework 3 review and summary
將大家 homework 2 需注意的地方,延伸思考的部分提出來
hatelove
July 24, 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 2 review and summary
hatelove
1
4.6k
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
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
130
コスト削減から「セキュリティと利便性」を担うプラットフォームへ
sansantech
PRO
3
1.2k
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
~Everything as Codeを諦めない~ 後からCDK
mu7889yoon
3
250
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
2
830
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
1k
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
380
Oracle Cloud Observability and Management Platform - OCI 運用監視サービス概要 -
oracle4engineer
PRO
2
14k
Deno・Bunの標準機能やElysiaJSを使ったWebSocketサーバー実装 / ラーメン屋を貸し切ってLT会! IoTLT 2026新年会
you
PRO
0
290
10Xにおける品質保証活動の全体像と改善 #no_more_wait_for_test
nihonbuson
PRO
1
150
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
2026年はチャンキングを極める!
shibuiwilliam
9
1.9k
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
89
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
250
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Into the Great Unknown - MozCon
thekraken
40
2.2k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
A better future with KSS
kneath
240
18k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
910
Transcript
Date: 2012/06/28 OO training – homework 3 review
- 2 - Context與工廠職責分離 • new class的動作與使用class的動作分開 – context為使用場景 –
生成物件為工廠的職責 – 使用class都應相依於介面
- 3 - 職責分離 • BL也要遵守單一職責原則 – 商業邏輯不代表得把domain併在一起 • 禁止跨層叫用
– 例如:頁面叫用DA層
- 4 - 依賴於介面 • 物件相依於介面,而非實體 class • Log, Setting,
DA 的介面使用 – 開放封閉原則 – 容易抽換 • 物件結合方式 – constructor – public property – 注意!沒有值給預設值作法的問題 • 應改為 assert / contract 方式的防呆與檢查 • 或透過 overload 無參數 constructor 來給預設值
- 5 - 封裝 • 介面上只開放需要用的方法 – YAGNI ( You
ain’t gonna need it ! ) 原則 • 將實作細節封裝成抽象意義 – 將QueryString封裝成property – 將ViewState封裝成property
Q & A