6
用有意义的类名屏蔽Java集合的好坏方法?
最近,我习惯于用人类友好的类名“掩盖” Java集合。一些简单的例子: // Facade class that makes code more readable and understandable. public class WidgetCache extends Map<String, Widget> { } 要么: // If you saw a ArrayList<ArrayList<?>> being passed around in the code, would you // run away screaming, or would you actually understand what it is and what // …