-
Notifications
You must be signed in to change notification settings - Fork 34
CountryController: remove dependency on SeriesService by moving showInfoBySlug() method #1052
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
Comments
So in CountryController - showInfoBySlug method internally uses -> seriesService.findByCountrySlug . Can you elaborate? Thanks. |
Note that you shouldn't work on this issue yet because I've realized that it's not so easy to fix it as I thought before.
The idea was to move the method showInfoBySlug() from CountryController to SeriesController. But I realized that it's not I really want as it won't fix the issue really. |
In order to give you overall understanding on what is all about: I'm trying to split everything by features (country, category, series, collection, etc). All the classes that belong to a feature should be placed into the same package. Also we shouldn't have circular dependencies between packages. For example, package "country" shouldn't depend on a package "series" because the latter already depend on the "country" package. That's why I had idea to move this method to SeriesController because it uses SeriesService and we have a dependency on "series" package. But I don't like a fact that SeriesController will have an endpoint for "/country/{slug}" URL. It seems a little weird. So, that's why I cancelled a work on this issue for a while. |
At this moment, I have an idea to introduce an endpoint on SeriesController and make CountryController to fetch data from SeriesController. For example, here is how it looks like now: The proposal is to make it looks like: But it still not perfect as SeriesService/ServiceDao work with /country/{slug} -> CountryController -> /series?country_id=$id -> SeriesController -> SeriesService -> SeriesDao Here is what I'm thinking about now. I'll be happy if you have ideas on that. |
Another idea: |
The puzzle
927-4ad1152b
from #927 has to be resolved:mystamps/src/main/java/ru/mystamps/web/feature/country/CountryController.java
Line 88 in 6fc61a2
The puzzle was created by Slava Semushin on 16-Jun-19.
The text was updated successfully, but these errors were encountered: