Spotify-NetStandard
Spotify-NetStandard copied to clipboard
Feedback
Nice that you're creating this! I was wondering whether you considered https://github.com/reactiveui/refit to simplify creating your REST client?
Thanks - I'd based this client on the Groove Music SDK but anything I can do with it later might be worth considering as a later improvement using something like this!
The REST Library has been rewritten to improve the workflow, hopefully this makes it much easier to understand
I meant that it might make it much easier for you to maintain this library and to add new functionality if you do not hand-write the REST Client code yourself. Also it might make your code much cleaner.
Refit just asks you to write a .Net interface and specify the REST method, parameters and url route to disclose an endpoint.
More specifically, it would make a part of the contents in your Spotify.NetStandard/Spotify.NetStandard/Client/Internal folder redundant. I understand you started from the Groove Music SDK but I believe using Refit would be much simpler.
Besides the point about Refit, I was wondering how you think about the circular dependency between SpotifyApi and SpotifyClient. Personally I find it very confusing and I think it could improve the code if there is one class that makes the REST calls and one class that might add some logic to the REST calls.
Good point about that circular dependancy - I'd intended that ISpotifyApi Interface to be a wrapper for the ISpotifyClient one but agree it is confusing and could refactor this to remove that
Nice :) I was wondering whether you've had the chance to look at Refit, and what you think of it?
My recommended approach would be:
- let
ISpotifyApihandle all REST calls using Refit attribute decorations - remove
SimpleServiceClient- all this code can be generated using Refit so that you do not need to maintain it - create
ISpotifyClient/SpotifyClientfor the extra logic on top of the REST calls (e.g. the modification of parameters, etc). In the implementation, useISpotifyApito make the API calls. - use the authentication pattern from Refit to handle the authentication part