The single-responsibility principle (SRP) keeps each class responsible for one piece of functionality and limits its reasons to change. Small, independent services can then combine into a complete application. section 3.7.1
An order total built from focused services
An e-commerce application can use TaxCalculator for tax, ShippingCostService for shipping, and OrderTotalCalculator to combine both results. OrderTotalCalculator should use those services rather than calculate every concern itself. section 3.7.1
SRP encourages a practical separation of responsibilities:
- Give each class one independent piece of functionality. section 3.7.1
- Avoid combining service use with dependency construction; dependency injection lets another class provide required services. section 3.7.1






