Я добавил бы больше шага вне частного конструктора:
public class Foo {
// non-instantiable class
private Foo() { throw new AssertionError(); }
}
Бросок эти AssertionError
предотвращает методы в том же классе от инстанцирования класса (хорошо, они могут попробовать). Это обычно не проблема, но в среде команды Вы никогда не знаете то, что кто-то сделает.
Что касается "абстрактного" ключевого слова, я заметил классы утилит, разделенные на подклассы в многочисленных экземплярах:
public class CoreUtils { ... }
public class WebUtils extends CoreUtils { ... }
public class Foo { ... WebUtils.someMethodInCoreUtils() ... }
я полагаю, что это сделано так, чтобы люди не помнили который служебный класс включать. Там какие-либо оборотные стороны к этому? Действительно ли это - антишаблон?
С уважением, LES
This mysql-forum-thread about indexing views gives a lot of insight into what mysql views actually are.
Some key points:
A view can be simply thought of as a SQL query stored permanently on the server. Whatever indices the query optimizes to will be used. In that sense, there is no difference between the SQL query or a view. It does not affect performance any more negatively than the actual SQL query. If anything, since it is stored on the server, and does not need to be evaluated at run time, it is actually faster.
It does afford you these additional advantages