https://kotlinlang.org logo
#random
Title
s

Shawn

06/23/2021, 9:02 PM
I wrote a pseudo-scope function in Java today to make some old-style construct-and-call-setters POJOs a bit easier to work with, and I’m not sure what to call it. Going by the Scope functions table, the conditions this function fulfills are • Object reference:
it
Return value: Context object • Is extension function: No: takes the context object as an argument. None of the existing names really match how this function is used (though I guess
also
is close) and the best name I’ve been able to come up with is
build()
, but maybe there’s something better?
m

marstran

06/24/2021, 8:06 AM
I've done something like this, and I just called it a DSL. Its usage looked something like this:
Copy code
DSL.enterDSL()
   .config(config)
   .subDsl(dsl -> dsl
      .subDslConfig(subConfig))
   .build();
Maybe "scoped builder" is a fitting name?