You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when calling functions like get_track_status() the raw Google Play response is returned to the caller. For example, check_rollout() is closely coupled with the result of the Google Play API.
This has two costs:
When the API changes, we need to update a lot of our code, rather than just the interface layer between our code and Google Play
When contact_google_play is False, the mock connection is really complicated, since it needs to carefully mock out the Google Play response in a way that's compatible with the rest of the codebase
Instead, perhaps we should structure the data returned by the googleplay layer. For example, for get_track_status(), return a list of Release:
class Release:
# name
# is_in_progress
# user_fraction
Thanks for filing and documenting this issue. I agree, because we want to support Amazon, the need for the adapter pattern comes up. I agree to stop returning the raw response. Although, defining classes might be overkill for now. Returning a simple dict should be enough, the current data fits in this type of structure.
Although, defining classes might be overkill for now. Returning a simple dict should be enough, the current data fits in this type of structure.
Hmm, I've always considered that if a data structure is known up front, then it usually makes sense to represent it in a class - it provides the IDE/runtime additional information about the properties in the object, and even readies the data structure to be typed.
Is there a case in which a non-dynamic data structure makes more sense as a dict rather than a class?
Currently, when calling functions like
get_track_status()
the raw Google Play response is returned to the caller. For example,check_rollout()
is closely coupled with the result of the Google Play API.This has two costs:
contact_google_play
isFalse
, the mock connection is really complicated, since it needs to carefully mock out the Google Play response in a way that's compatible with the rest of the codebaseInstead, perhaps we should structure the data returned by the
googleplay
layer. For example, forget_track_status()
, return a list ofRelease
:@JohanLorenzo what do you think?
The text was updated successfully, but these errors were encountered: