--- robots: noindex, nofollow tags: refactoring --- # Temporary Field  ## 徵兆與症狀 變數只會存在於特定情況下,在特定情況之外,這些變數會是空的。 ## 出現原因 暫存欄位通常在要處理的演算法有很多數量的輸入時被使用,與其使用一個具有很多參數的方法,開發者通常會建立一些暫存欄位,而這些欄位只被特定演算法使用到。 ## 處理方法 - 使用 `Extract Class` 將暫存欄位抽取到另一個類別。 - 使用 `Move Function` 將相關的程式碼移到新建立的類別去。 - 使用 `Introduce Special Case` 來處理當暫存欄位不合法的情況。
×
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