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

Check the valid use of lists in our data structures #44

Closed
Pfeil opened this issue Aug 12, 2022 · 4 comments · Fixed by #183
Closed

Check the valid use of lists in our data structures #44

Pfeil opened this issue Aug 12, 2022 · 4 comments · Fixed by #183
Assignees
Labels
breaking Solving this will break the API and require a new major version. code quality Mostly internal changes to improve the code quality. good first issue Good for newcomers
Milestone

Comments

@Pfeil
Copy link
Member

Pfeil commented Aug 12, 2022

We use lists in many places, and I think in most of them a set would be the better solution. API changes will be possible here, though. So we have to be careful and deprecate old APIs.

@Pfeil Pfeil added the good first issue Good for newcomers label Aug 12, 2022
@Pfeil Pfeil added this to the 2.0 milestone Aug 12, 2022
@Pfeil Pfeil added the code quality Mostly internal changes to improve the code quality. label Aug 12, 2022
@Pfeil Pfeil changed the title Check the valid use of lists in our data structures. Check the valid use of lists in our data structures Aug 12, 2022
@Code42Cate
Copy link
Contributor

In AbstractDataEntityBuilder, List<String> authors = new ArrayList<>(); should be a set.

@Pfeil
Copy link
Member Author

Pfeil commented Aug 15, 2022

This builder method takes a list and puts things into a set. From the functionality perspective, allowing all Collections would be possible. This one should not even break the API, as List also implements Collection. Probably there are more places where we can make use of Collection<>.

@Pfeil
Copy link
Member Author

Pfeil commented Aug 25, 2022

We should consider keeping the order of author lists (and see how we currently do it). While we'll need to support that, I would like to encourage to give roles to people, like author or reviewer, via the API.

@Pfeil Pfeil self-assigned this Aug 21, 2024
@Pfeil
Copy link
Member Author

Pfeil commented Aug 21, 2024

For the APIs, we should consider using Collections and/or Streams. Not yet sure what the best use case would be in our case. Internally we may use what is there for now, or adjust it to our needs.

Related: https://www.baeldung.com/java-return-stream-collection

@Pfeil Pfeil added the breaking Solving this will break the API and require a new major version. label Aug 30, 2024
@Pfeil Pfeil closed this as completed in #183 Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Solving this will break the API and require a new major version. code quality Mostly internal changes to improve the code quality. good first issue Good for newcomers
Projects
None yet
2 participants