Learning pathsA
Foundations

SOLID and composition

Design for a concrete change that is likely to happen.

Understand the problem

Separate policy from mechanism. Inject a pricing strategy or storage interface where variation is real. Composition lets behavior vary without coupling it to an inheritance tree.

Make it concrete

A payment service depends on a PaymentGateway contract; provider-specific adapters implement it.

Trade-offs and pitfalls

Interfaces without multiple consumers or meaningful boundaries may add indirection without value.

Check your understanding

Refactor a notifier that hardcodes both email and SMS.

Practice this topic

Your study notes