After: source dependencies

Outer adapters depend on the application-owned contract

After: source dependencies Outer adapters depend on the application-owned contract HTTP Handler · quotehttp · Architecture component HTTP Handler quotehttp Use Case + Port · quote: Catalog interface · Architecture component Use Case + Port quote: Catalog interface Price Rule · domain · Architecture component Price Rule domain HTTP Catalog · cataloghttp: implements Port · Architecture component HTTP Catalog cataloghttp: implements Port Test Catalog · test double · Architecture component Test Catalog test double imports imports imports Product / Port imports Product Legend Backend

Read this arrow carefully

  • • quote does not import cataloghttp.
  • • main wires the concrete client into quote.New(client).
  • • Runtime still calls the HTTP client through the interface.