🏗️Separation of Concerns
Also known as SoC, Concern Separation
Giving each part of a program one job. Each part is kept apart from the rest.
Think of it like
Think of it like a kitchen with a sink, a stove and a fridge. Each spot does one job.
Example
Lucy's app mixed database calls into its page code. She moves them into their own file. Now she can change the database without touching any page.
Why it matters
It keeps changes small and safe. You can work on one part without reading the whole program.
Definition
Common mistake
Key takeaways
- 1One job per part. Each concern on its own.
- 2Changes stay local. No spill into others.
- 3Split by job. Not just by size.