Skip to content
Discussion options

You must be logged in to vote

“What is the recommended way to implement plugins in Kotlin/JVM today?”

Short answer:
👉 Use a Java-compatible plugin model built around a shared API module + ServiceLoader, with explicit lifecycle management. Kotlin does not replace JVM fundamentals here—it builds on them.


🧠 Key Principle

Kotlin runs on the JVM, so the recommended approach is still:

Well-defined interfaces + controlled class loading + minimal reflection

Kotlin’s strengths (null safety, data classes, DSLs) help you design a clean API, but plugin loading itself remains a JVM concern.


🏗️ Recommended Architecture

1️⃣ Separate api module (critical)

Create a pure API module that both the host app and plugins depend on.

root…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Anuja122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Programming Help Discussions around programming languages, open source and software development Welcome 🎉 Used to greet and highlight first-time discussion participants. Welcome to the community!
2 participants