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 Session class from Java to Kotlin #631

Closed
johnjohndoe opened this issue Mar 20, 2024 · 0 comments · Fixed by #635
Closed

Migrate Session class from Java to Kotlin #631

johnjohndoe opened this issue Mar 20, 2024 · 0 comments · Fixed by #635
Assignees
Labels
Housekeeping Clean-up and resolving technical debt.
Milestone

Comments

@johnjohndoe
Copy link
Member

Current state

  • The Session class in the app module is written in Java.
  • As the central data holder in the UI layer its usage is wide-spread and critical to all app features.
  • Fields of the class are public, hence can be modified from external.
  • The class contains static functions which are contextual related to the Session class.
  • Not all field are part of the equals and hashCode methods.

Target state

  • The Session class in the app module is written in Kotlin as a data class.
  • Properties of the class are initialized at construction time and cannot be modified. This makes Session instances immutable.
  • Static functions are moved into separate well named files/classes.
  • Not all field are part of the equals and hashCode functions implicit data class. This might be addressed in subsequent issues / merge requests.

Motivation

  • Mutable Session instances which miss the benefits of a Kotlin data class make development uncomfortable.
  • Writing tests with Session Java instances is cumbersome and painful. Writing test should be fun!

Approach

  • The migration happens step-wise to facilitate small, easy to comprehend commits.
  • Clean-up happens before larger, and functional changes.
  • Tests are added before a change to prevent introducing bugs.

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Housekeeping Clean-up and resolving technical debt.
Development

Successfully merging a pull request may close this issue.

1 participant