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

Rewrite inheritance with composition for the PositionedNote class #106

Closed
albertms10 opened this issue May 12, 2023 · 0 comments · Fixed by #113, #126 or #155
Closed

Rewrite inheritance with composition for the PositionedNote class #106

albertms10 opened this issue May 12, 2023 · 0 comments · Fixed by #113, #126 or #155
Assignees
Labels
refactor The code needs to be refactored
Milestone

Comments

@albertms10
Copy link
Owner

albertms10 commented May 12, 2023

Description

  • Remove the extends Note clause in the PositionedNote signature.
  • Use composition with a new note member of type Note.

Advantages

  • Clearer class structure, avoiding the confusing (even wrong) inheritance between Note and PositionedNote
  • Remove the covariant keyword from the difference method.

Acknowledgements

@plammens for suggesting the change.

@albertms10 albertms10 added the refactor The code needs to be refactored label May 12, 2023
@albertms10 albertms10 added this to the Road to 0.7 milestone May 12, 2023
@plammens plammens self-assigned this May 12, 2023
albertms10 added a commit that referenced this issue May 27, 2023
* fix(positioned_note): use correct `hashCode` values

Closes #106

* test(positioned_note): add explicit `hashCode` cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment