Ярлык для разделения на подклассы в Scala, не повторяя аргументы конструктора?

Закрывающий запрос идет, где все предикаты могут быть подобраны с помощью индексов на базовых таблицах.

Это - первый шаг к улучшению производительности sql на рассмотрении.

11
задан Daniel Worthington 31 October 2009 в 10:01
поделиться

2 ответа

I'm afraid you're on your own there. Constructors aren't inherited or polymorphic and subclass constructors, while they must and always do invoke a constructor for their immediate superclass, do not and cannot have that done automatically, except if there's a zero-arg constructor, which is implied by the mention of the superclass's name in an "extends" clause.

13
ответ дан 3 December 2019 в 04:13
поделиться
abstract class View {
    def writer: XMLStreamWriter
    // Implementation
}

class TestView(val writer: XMLStreamWriter) extends View {
    // Implementation
}

Это то, что вы ищете?

12
ответ дан 3 December 2019 в 04:13
поделиться
Другие вопросы по тегам:

Похожие вопросы: