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

Open Mic "How Kotlin guys would like to use it?" #1

Open
alexrochas opened this issue Mar 7, 2019 · 1 comment
Open

Open Mic "How Kotlin guys would like to use it?" #1

alexrochas opened this issue Mar 7, 2019 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@alexrochas
Copy link

@andreoav, @hyanmandian, @guilhermecomum, @lucassveloso do you guys have idea of how Kotlin guys would use it? In Android probably?

What do you think, something like field validation?

data Person(
  @CPF val cpf: Long
)

Or something more explicity like composition or ihneritance (like a trait)?

class PersonController: Validatable (
  private validation: CPFValidation
)

Or even static?

fun validateFields() {
  Validations.validateCPF(someCPF)
}

And I didn't even thought about how someone would use with the DSL features kotlin have. 😆

@alexrochas alexrochas added the question Further information is requested label Mar 7, 2019
@alexrochas alexrochas self-assigned this Mar 7, 2019
@andreoav
Copy link
Member

andreoav commented Mar 7, 2019

So.. I think you know Kotlin better than us.
I just did the Kotlin version of Hello World.

But, from my experience, static is "bad"... hard to test, hard to mock, DI... and many other buzz words.

Which one more idiomatic to Kotlin? I know that those data classes are specific to Kotlin, but annotations feels too much Java for me.

As a JS/GoLang dev, I always prefer composition.

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

No branches or pull requests

2 participants