? 從www.infoq.com上看到一篇文章,講的是一個高效程序員五個好習慣,特摘錄如下:
1.Constructor Performs Minimal Work(不要讓構造函數太累著)
2.Methods Clearly Convey Their Intent(人如其名)
3.An Object Performs a Focused Set of Services(不要狗拿耗子多管閑事)
?? how to categorize these object is worthy of considering.(entity object,service object,facade object)
4.State-Changing Methods Contain Minimal Behavior Logic(是非分明,不要糾纏不清)
?? determine the boundary is a litttle difficult.
5.Behavior Methods Can Be Called in Any Order(讓依賴離我們遠點)
?? 個人覺得3,4,5體現的是如何劃分領域模型和領域對象職責劃分的問題.我想Martin flower的SRP應該是我們應該遵守的原則之一.其它的暫時沒有想到啊,大家有建議么?