Skip to content

Glossary: Software Design Patterns in C++

Single responsibility principle

Also written: SRP

The S in SOLID: a piece of code should have one reason to change. `place_order` has many, so pricing and discounts are pulled out of it first.

Where the book teaches it

Related terms

SOLIDCohesionGod object