https://kotlinlang.org logo
#announcements
Title
# announcements
g

groostav

07/15/2016, 11:28 PM
so just, can i get the general thoughts on local extension functions? are they not really intended to be used outside of the class that declares them? EG I have
Copy code
class DomainModel(var a: Double, var b: Int)

class Extensions{
  fun DomainModel.doThings(config: Config){ /*...*/ }
}

class DomainModelGeneratingOrMutatingService{
  
  private val extensions: Extensions;

  fun someMethod(){
    val myDomainModel:  DomainModel = //...

    //only strategy to access those extensions is:
    extensions.run { myDomainModel.doThings(closureArgs) }
  }
}
is this something generally to be avoided?