process() declared with a concrete ArrayList parameter
process(orders)
consuming code · the body never changes
void process(ArrayList<Order> orders)
Socket accepts: only ArrayList
1
values that fit
Swap the implementation without editing this code?
✗No
—
—
▸Declare the socket (an interface like List), not a specific class. Flip to Interface type and watch every implementation plug in — the consuming code never moves.