MiloszKrajewski / stateful4k

State Machine Construction Kit for Kotlin
BSD 3-Clause "New" or "Revised" License
33 stars 0 forks source link

Dependency on Java #2

Open damianflannery opened 6 years ago

damianflannery commented 6 years ago

I was looking to use this state machine for a kotlin multiplatform project so that I can share some business logic across platforms however I hit a problem in that this project relies in java in a few places e.g. java.util, @jvmstatic, reference to Class etc.

Is it possible to remove these dependencies so it is pure kotlin or is that out of scope for this project?

MiloszKrajewski commented 6 years ago

I don't understand use case. "java.util" can be replaced by something more native to kotlin, but I wanted "jvmstatic" to make it idiomatic when used from java, singleton with weird name and instance methods, looks ugly.

I can be convinced though, why dependency on java bad?

damianflannery commented 6 years ago

Nothing against Java!

It's just that I'm looking to use the library on a kotlin multiplatform project and as such it cannot have any dependency on any other language

A common module can depend only on other common modules and libraries, including the common version of the Kotlin standard library (kotlin-stdlib-common). Common modules contain only Kotlin code, and not code in any other languages.

https://kotlinlang.org/docs/reference/multiplatform.html

BartoszKaszewczuk commented 6 years ago

I'm also interested in this. It would be nice to have libraries for Kotlin that support all things Kotlin and its aspects and FSM is a pattern so it would be a good candidate as such.