Interface segregation: payment methods

Let each client declare an interface with only the methods it calls, so no implementation has to fake the rest.

Level Intermediate

What you will see

  1. Four jobs, one interface
  2. Methods nobody calls
  3. Each client declares what it needs
  4. One struct, several roles
  5. How small is too small

Before / after

Base: interface-segregation-base-goView the diff

Exercises