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

Refactroing: instead of composition place values make an interface #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tobsesHub
Copy link
Contributor

@tobsesHub tobsesHub commented Jun 26, 2024

Here is my attempt to refactor the Place class as an interface.

While programming, I wasn't so sure anymore if this is really a good idea, because:

  1. is this a case of "composition over of inheritance"? So maybe the current composition solution is the better one. I also didn't find any advantages in the usage in our case. (Actually I have to use instance of instead of handling Optional now)
  2. my solution for deserialization I don't like very much. Instead of using Jackson default parsing, I had to parse many properties myself, which is very error-prone. I could make this maybe a bit easier by changing the records to non-final classes. But that might have drawbacks when using the library.

So we can merge this, I can improve it if you have an idea, or I can close this pr if you think it's better to keep the code.

 instead of composition place values make an interface
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

Successfully merging this pull request may close these issues.

1 participant