Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Kotlin #1

Closed
gesellix opened this issue Jun 11, 2017 · 3 comments
Closed

Migrate to Kotlin #1

gesellix opened this issue Jun 11, 2017 · 3 comments

Comments

@gesellix
Copy link
Contributor

My philosophy behind the Docker client (and as such this repo, too) is to keep the Docker facing side as flexible as possible. Types might be less convenient, so I have no idea whether Kotlin is counter productive. That's what I want to learn and gain some experience.

My main motivation to introduce Kotlin is the library's client facing side of the libraries. A strongly typed api certainly helps to use a library given a capable IDE. That way, the lack of documentation might be compensated to a certain degree.

Things to keep in mind:

  • There's no static modifier in Kotlin. static someMethod(){} could be converted to @JvmStatic fun someMethod(), but it would also be valid to simply remove the static modifier and make someMethod() an instance method.
  • We should focus on the production code first. Test code can also be converted to Kotlin, but with low priority. I'm a fan of the Groovy Spock framework and there's no equivalent in Kotlin, yet (I didn't find any). Spek seems to be the most similar alternative as of today.

See docker-client/docker-filesocket@620cc55 for a first try at converting from Groovy to Kotlin.

@gesellix
Copy link
Contributor Author

Hey @shekhargulati, I have no idea how to start exactly with the migration. If you have any specific idea, just tell me! I would start with the low level classes and work from bottom to up. In this actual library the de.gesellix.docker.compose.interpolation should be a good starting point, while de.gesellix.docker.compose.ComposeFileReader could be the final step.

The tests are no real unit tests, they are inspired/copied from the original Docker codebase and as such are quite high level. I guess that helps with the migration and ensures we don't completely break everything, so I would convert the tests only after the production code.

gesellix added a commit that referenced this issue Jun 11, 2017
@gesellix
Copy link
Contributor Author

Finished with d1ba6ee

@gesellix
Copy link
Contributor Author

Follow-up in the docker-client: gesellix/docker-client#44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant