stateful4k icon indicating copy to clipboard operation
stateful4k copied to clipboard

Dependency on Java

Open damianflannery opened this issue 6 years ago • 3 comments

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?

damianflannery avatar Mar 18 '18 14:03 damianflannery

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?

MiloszKrajewski avatar Mar 28 '18 12:03 MiloszKrajewski

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

damianflannery avatar Mar 28 '18 20:03 damianflannery

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.

BartoszKaszewczuk avatar Nov 10 '18 15:11 BartoszKaszewczuk