liveBook · Manning

Interface-oriented design

As explained in Build High Value Software Systems

A software-design approach that organizes components around explicit interfaces separated from their implementations.

Interface-oriented design (IOD) defines contracts between components before implementation. Dependent services interact through those contracts, allowing implementations to be swapped without changing integrations. section 4.1.2

Listing 4.3 Interface approach to allow implementation freedom
public interface PaymentProcessor {
    PaymentResult charge(BigDecimal amount);
}
 
// Implementation details come later
// Could be DebitCardPaymentProcessor, CreditCardPaymentProcessor, etc.

A payment processor contract specifies a charge operation while leaving the implementation open to alternatives. section 4.1.2

Use interfaces when there is evidence that implementations will need to change. Speculative contracts can become unused inventory, adding overhead without providing useful flexibility. section 4.1.2 section 4.1

How Build High Value Software Systems covers it

How deep it goes
Defines contracts and explains their coupling benefits and speculative cost, without detailing implementation mechanics.
Examples
Uses a PaymentProcessor contract with a charge operation and possible debit- or credit-card implementations.
What you can do after
Evaluate whether evidence of implementation changes justifies an interface before adding the abstraction.
How it connects
Compares IOD with TDD, BDD, DDD, and Spec Driven Development as approaches that shift the trusted abstraction.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build High Value Software Systems. The section links point to the parts of the book it draws on.