jakub-tucek / fit-checker

Fit-checker 2.0 for CTU FIT
MIT License
1 stars 0 forks source link

Generic NetworkOperations #23

Closed josefdolezal closed 7 years ago

josefdolezal commented 7 years ago

Before we start implementing new features (such as KOS, Obedar/LunchGuy, ..) we should refactor network operations. Now there are 3 operations (2 html, 1 json).

Each operation now has similar structure to this:

init(someArgs:) {}

override func start() {}

func handle(response:) {}

Lets make some generic abstraction over these operation. My suggestion is:

  1. Make custom serializer for Realm objects docs
  2. Add generic methods success and failure, where failure may have default implementation (in protocol or parent class)

We can discuss it here and then split it into multiple issues.