Avoid duplicate code
當發現重複的程式碼片斷時,通常代表「設計」有問題。例如責任放錯了類別,或者是否應該delegate到別的類別等等。
Encapsulate what varies
Code to an interface rather than an implementation
Each class in your should have only one reason to change
Classes are about behavior and fuctionlity
在系統中的每個物件只有單一的責任
沒有留言:
張貼留言