Three notification channels need seven subclasses
transcript
Email, SMS, push. Customers mix them. Give every mix its own class, and you need 7. Email only. Email and SMS. All three. And four more.
Two channels? Three classes. Three channels? Seven. Four channels? Fifteen. Every new channel doubles it, plus one. The code grows faster than the feature.
The same line gets copied everywhere. Change the SMS wording? Edit 4 of the 7 classes. A customer turns SMS off in settings? That needs a different class, not a different setting.
But here's the catch. An email-and-SMS sender isn't a kind of email sender. It has an email part and an SMS part.
The notifier holds a list of channels. Each channel is one small class. A fourth channel is one new class. All 15 mixes already work. And each customer gets their own list, at run time.
Combinations are lists, not classes. When things combine, build with parts instead of a class tree.
Full breakdown in the lecture.