Skip to content

Instantly share code, notes, and snippets.

@eskatos
Created April 24, 2017 06:07
Show Gist options
  • Save eskatos/308d063d016c5cd018db3f6808898902 to your computer and use it in GitHub Desktop.
Save eskatos/308d063d016c5cd018db3f6808898902 to your computer and use it in GitHub Desktop.
Playing with Polygene & Kotlin
val application = Energy4Java().newApplication(
ApplicationAssembler { factory ->
factory.newApplicationAssembly("Application 1") {
mode = Application.Mode.development
version = "1"
setMetaInfo(Object())
val layer1 = layer("Layer 1") {
module("Module 1/A") {
values(Some::class) {
withTypes(Some::class)
forMixin(Some::class).declareDefaults {
foo().set("bar")
}
}
}
}
val layer2 = layer("Layer 2") {
module("Module 2/A") {
services(Some::class) {
instantiateOnStartup()
}
}
}
layer2.uses(layer1)
}
})
application.activate()
application.passivate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment