本文共 994 字,大约阅读时间需要 3 分钟。
Will 说:
Nice code.Well, I have 2 comments.
1) You can remove the forward function calls in UserInfo, so as to make UserInfo decoupled from the o/r mapping utilites, for more compact code and less coupling
2) It is better to let UserUtilities to return a collection of UserInfo (e..g IList<UserInfo>) other than DataSet, so that the client code is less coupled with ADO.NET techonology
Will 说:The pattern you used in UserInfo is called "Active Domain Object". In my personal opinion, I prefer not to use this pattern and keep the domain objects pureCasper Liu 说:o, thanks very much... I will think about your suggestion and have a discuss Will 说:The philisophy is that Domain Objects should only have the knownledge on how to manage its internal state information, but not to have the knownledge on how to persist itself - this kind of knowledge tends to change with time, and should be owned by some "professinoal" externals else(O/R mapper and its related configuration info, for example)转载地址:http://gxgmi.baihongyu.com/