Loading lesson…
Level 1 · Apprentice0 XP
Split two independent dimensions so they can grow without multiplying classes.
Step 1 / 5
ProblemNotifications come in Urgent and Normal, and are sent by Email, SMS and Push. Inheritance creates UrgentEmail, UrgentSms, NormalPush... Adding Slack means three new classes.
← → step
Before this: Adapter and Facade
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Refactor a hierarchy of UrgentEmail, UrgentSms, NormalEmail and NormalSms into a Bridge. Add a Slack channel and a Digest notification kind and count the classes before and after.