16. Proxy
MediumStructural1 hidden requirement
Letting a stand-in defer the expensive work until somebody actually asks for it
Dashboard renders a report, and the tests pass.
It asks for the body in its constructor and keeps the string — so the moment a Dashboard exists, the query has run, whether or not anyone ever looks at it.
LazyReport is a Report that builds the real one on first use. Rewrite Dashboard so it holds the report and asks when it renders.
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.