Conversation
|
@nmodi - Great PR. Looking through the code, it appears that only the base_url and host header are actual differences from the live/nba endpoint. Can you confirm? I'm curious on your opinion of two approaches in order to avoid duplicating the code.
example:
Pros and cons for both. thoughts? |
|
"it appears that only the base_url and host header are actual differences from the live/nba endpoint" Yes, this is correct. If we want to reduce code duplication, I would lean towards the second option. Most of the code would be identical; the only difference would be to use a different HTTP object. |
|
If the code is similar enough then I think using the LeagueID parameter might be a better and cleaner approach for long term maintenance. My opinion is that we should only do the more abstracted / code heavy approach if we have a need and can't accomplish it with the easier approach. |
Added boxscore endpoint for Live WNBA data.
My initial approach was to simply create a new WNBALiveHTTP class and switch which LiveNBAHTTP class to use (in the existing endpoint) based on gameID, but this seemed to conflict with the pattern used in the rest of the repo. Another issue with my initial approach is that there would be an inconsistency with the Scoreboard endpoint which does not rely on a gameId, unless we required a league parameter be passed in.
Instead, I created a new endpoint within a wnba package. I added only the boxscore endpoint to start, for approval on this design. I'm also happy to switch back to the initial approach or discuss on this.
Please let me know if I missed anything!