Loading lesson…
Level 1 · Apprentice0 XP
Control how objects get created, so callers stop knowing the details.
Step 1 / 5
ProblemFive places create a notifier and each decides on its own whether it is email or SMS. When a third channel arrives you hunt for every one of them.
← → step
Before this: Strategy: replace the if-else ladder
🛠️ 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.Create an interface Exporter with CsvExporter and JsonExporter, and an ExporterFactory with forFile(name) that picks by file extension. Then add XmlExporter and count how many files you had to touch.