Pick the fix
A profile screen can open from a push notification, a deep link or the home list, and needs the same dependencies each time. What helps most?
Hint 1 of 1
Where should wiring live?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A A factory, such as ScreenFactory.makeProfile(id:), that wires dependencies in one place
Correct. Every entry point gets the same correctly built screen.
Why not the others?
- B Build the dependencies separately at each call site. The wiring gets duplicated and drifts.
- C Make every dependency a singleton. Hidden global state is hard to test.
- D Subclass the screen for each entry point. The difference is where it starts, not how it behaves.