Dependency inversion: confirming an order

Make the business code own the interfaces it needs, and let the infrastructure plug into them.

Level Intermediate

What you will see

  1. Who chooses the mailer?
  2. Glued to the infrastructure
  3. The checkout owns the interface
  4. Receive, don't create
  5. One place to choose
  6. When to keep it concrete

Before / after

Base: dependency-inversion-base-goView the diff

Exercises