4. Interface Segregation
MediumSOLID1 hidden requirement
Asking for the narrowest interface that does the job
PayrollRun prints payslips. That is the whole of it, and the tests pass.
Its parameter is a Printer, which promises printing, scanning and faxing — so anything that wants to run payroll has to provide all three.
Prints is already declared and OfficeMachine already implements it. Change what PayrollRun asks for.
Run compiles every file and runs Tests.java — the tests you can read.
Submit runs those again, then applies 1 requirement you have not seen, one at a time.
Your code is never edited. Each requirement is added to the project as it stands. If the design is right, nothing you wrote has to change.
- Ctrl/⌘ + Enter runs the tests
Run the tests to see where you are.
Hidden requirements
Stdout
TERMINALPROBLEMSOUTPUT
Try:
honeytrap shell. Two commands are wired up: cd and cat.