--- robots: noindex, nofollow tags: refactoring --- # Insider Trading  ## 徵兆與症狀 一個類別過度使用其他類別的欄位或方法。 ## 出現原因 一個類別跟其他類別的耦合太高,需要持續彼此交談才能夠完成任務。 ## 處理方法 - 類別之間責任不清,可以用 `Move Function` 及 `Move Field` 釐清責任。 - 如果兩個類別之間有共同興趣,那就創立一個新的類別,然後用 `Hide Delegate` 做隔離。 - 如果責任不清的關係是由繼承產生的,可以用 `Replace Subclass with Delegate` 或 `Replace Superclass with Delegate` 來處理。
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up