Do you prefer ```abstract class A { abstract fun...
# codereview
e
Do you prefer
Copy code
abstract class A {
  abstract fun doSomething()
}
with
Copy code
object: A() {
  override fun doSomething(){}
}
or
Copy code
class A(private val doSomething: () -> Unit)
with
Copy code
A() {...}
?
a
Usually the first, I don’t remember ever using a constructor with a trailing {…} block (took me a few seconds to parse what was going on)
☝️ 1
although if A is an interface with a single method, can’t it now be satisfied by a lambda? (I know that used to be just for Java SAM interfaces, but I thought it had been extended to Kotlin ones too)
3
m
If understand correctly you’re choosing between two styles to implement the Strategy pattern?
e
it is scroll listener class for pagination, it calculates when next page should be loaded and call the abstract function