浏览 1376 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (9)
|
|
---|---|
作者 | 正文 |
发表时间:2009-10-06
最后修改:2009-10-21
Item 13: Minimize the accessibility of classes and members Item 14: In public classes, use accessor methods, not public fields Item14为新加的条目。 Item 15: Minimize mutability Item15原为Favor immutability. 现在改成了Minimize mutability,覆盖的范围更广一点。 Item 16: Favor composition over inheritance Item 17: Design and document for inheritance or else prohibit it Item 18: Prefer interfaces to abstract classes Item 19: Use interfaces only to define types Item 20: Prefer class hierarchies to tagged classes Item20为新加的条目。解释了在类的设计中引入tag field的坏处,以及如何用类的继承体系去实现相似的功能。 Item 21: Use function objects to represent strategies Item21为新加的条目。这个条目好像意义不大,讲解了java在没有原生函数指针的情况下如何用其他手段完成函数指针的功能。 Item 22: Favor static member classes over nonstatic 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |