-
Notifications
You must be signed in to change notification settings - Fork 4
Feat/refactor request classes #50
base: develop
Are you sure you want to change the base?
Conversation
It exists many dependencies between the main java and all the requests classes/methods, I had to change some classes and method to public from package-private due to this. We'll see if we can come back to something less permissive
salty
Got no one
fashion wars 2
|
Sorry, I wasn't clear when I write the issue description for #43. So what I meant by split the request by the API endpoints is actually to put every path segment, in bold text, and its child segments (See here) in one request class. For example,
So the
I do realize with this way of splitting the requests, some request class will be really long (e.g., the request class for I see what you are trying to do and my apologies for not been clearer. But as you might realize, with your current approach we will end up with a literal tons of classes, which might cause us to go from one extreme (everything in one class) to an other extreme. However, I'm actually warming up to your current approach, I just not sure if I'm ready for the literal tons of classes. I'm definitely open to suggestions. Thank you so much for what you have done. I really appreciate it! |
|
To answer your question, I prefer your first example: |
|
Yes it's becoming really huge with 1 or 2 methods per class, I can see what you want, I'll finish the work with 1 endpoint and its children in one class |
new organization start
|
Ok now it should be better, gonna do sync requests now :) |
|
Sync requests got the same name as async, what would be your way of choice to handle this ? |
#43
I've got to change methods accessors from
Requestand move classes to new packages.Actually I'm just doing it the easy way, breaking each endpoints from the
AsynchronousRequestclass to each new endpoint classes.There is something I would like to know, I made an example in the code, for example if you got that endpoint
/v2/account/dungeons, would you prefer it organized like :v2/account/Dungeons.java
v2 (package)
|__ account (package)
|__ Dungeons.java
OR
v2/account/dungeons/Dungeons.java
v2 (package)
|__ account (package)
|__ dungeons (package)
|__ Dungeons.java
Tell me what you think, and I'll make changes for the Synchronous requests :)