bjedrzejewski / chessmates

Statistics for your Lichess team
1 stars 3 forks source link

Consider re-introduction of model objects #56

Open janakerman opened 7 years ago

janakerman commented 7 years ago

The understanding of the structure of our model objects (currently just the parsed JSON returned from Lichess) is happening in multiple places throughout our application. If this structure changes, it will cause changes in a lot of places in our app, made more difficult by the fact that this is dynamic.

We could create a model object that just wraps our parsed JSON and encapsulates the accessors into this data. In terms of serialising the data to our consumers, we could still pass on the full map.

Benefits of this:

bjedrzejewski commented 7 years ago

I would like to make sure that we still store the whole lichess object whenever possible.

janakerman commented 7 years ago

Agreed I also think that is important. This task would only be protecting ourselves from the work required from future changes to Lichess' API. I'd be happy to access the structure of maps under the hood.