time (usually ~1-2 weeks) • "Breaking" API implies client users are left in the dark for 2-3 weeks • This is not acceptable LONGEVITY iOS client perspective
I ship client 2 months before its death? • Should I be afraid my client will break? • What about the rest of the API? • Wipe the slate clean every two years (or not) LONGEVITY VS. EVOLUTION
can evolve • Tune communication without redeploying clients • Move fast! • Less code! • Less maintenance • Less worries • Better life and everything* PROMISES * your results may vary
not make assumptions about the counterpart implementation • Do not reimplement server logic in your client • Let server drive your interactions with resources • Focus on domain semantics DECOUPLING
to 100. But for multiples of three print Fizz instead of the number and for the multiples of five print Buzz. For numbers which are multiples of both three and five print FizzBuzz.”
• Server knows how to calculate FizzBuzz for given number • Server knows what is the next FizzBuzz • Clients may decide what is the step and at what number to end FBAAS FizzBuzz as a Service
GET /fizzbuzz?number=i 3: print answer • Why is this coupled: • tied to a particular URL • iteration makes assumptions over the result (consider returning multiple results)
while answer.hasLink(“next”) 4: answer = answer.follow(“next”, step: STEP, end: END) 5: print answer • Why is this decoupled: • No hardcoded URLs • No logic about the algorithm • Completely driven by the resource
• Understand HTTP • Understand representations (links, relations, embedded resources) • Surf the API • Generic clients can be reused by specific clients • Specific clients just needs to understand API domain semantics.