-
Notifications
You must be signed in to change notification settings - Fork 8
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
Re-grouping of package structure for controller and output classes #117
Comments
I think reorganizing the package structure for the controller is a good idea. The actual package structure is misleading. |
Yes, I think so too. When taking a look at the executor and output package structure, I think there are also some restructuring actions necessary. I will also work something out for those packages and post it then here. |
For the However, for the output, it currently looks like that:
Here is actually also the issue, that some classes are grouped falsely, e.g. the two interfaces Proposed new structure:
With this structure, we will be again in-line with the different endpoints, together with having 2 additional grouping packages ( edit1: removing |
I really like the idea to make them be in-line with each other. 👍 But why call it
Here, I would personally tend to split it into a dedicated class for aggregations like
the proposed structure sounds good as well. The only(?) difference is that there is no distinction in the PS: The |
Good point, something like
Yeah I was a bit unsure about that one again last week when I was working more with contributions/count. There are some limitations on how we can define the swagger structure via the controller classes. I was playing around a bit with that last week and think I hit a wall when trying to define a different set of parameters for two end points that are in the same controller class, which would be the case and need for /contributions and /contributions/count (without specifying everything manually via annotations before every endpoint of course). So I guess it could end up that we have to go for a multi-class solution here if we want to stick with swagger how we use it at the moment.
We have here the class
The groupByResponse is already used across different endpoints, e.g. also /users uses it. The same goes for the ratioResponse. That's why they have their own package and are not within the other ones. |
What do you think about structuring Description.java
dataaggregation
dataextraction
metadata
groupbyresponse
ratioresponse
Description.java, Result.java, Response.java, and Attribution.java are not in a subpackage of |
@bonaparten thanks for your suggestion. about about The main difference that I see then is that you use a |
Metadata.java could be put outside the metadata package and not having a subpackage.
maybe DataExtractionResponse.java? Anyway, I am happy also with your solutions. if you prefer one structure more than another it is ok for me :D. There is not a perfect way to structure packages. We know we should change the package structure, this is the main thing. |
👍
This class is used for the |
|
How about the following:
I would add the |
it is fine |
Due to the limitations given by Swagger in regards to the controller packages, I had to make some adaptions in that structure. Please have a look at the structure as it it now in #124. |
It would be also nice to rename the classes |
Agree, there are also other parts of the code, where some renaming/restructuring would be useful. We could potentially discuss about all these parts in another issue and then work on them step-by-step. Can you create an issue for that @bonaparten? |
When starting with the implementation of #115 I ran into the following issue: We have a
ContributionsController
under thecontributions
package and then other controller classes likeCountController
,AreaController
, etc. under thedataaggregation
package. Now I want to add a data aggregation endpoint to thecontributions
.Since we are still working with contributions and need the contribution-view of the OSHDB here too, I'd suggest to add another package level.
Current package structure:
Proposed new package structure:
The new package structure would be in-line with our endpoint structure and in my opinion a better grouping. As the
aggregation functions
that can be applied on thecontributions
are rather limited, I'd suggest adding them to theContributionsController
(like we've done it with theUsersController
as well) and not make anotherCountController
inside thecontributions
package. Feedback appreciated.The text was updated successfully, but these errors were encountered: