Loading…
Loading…
This is the most commonly cited example for combining multiple patterns in one design. Consider separately: (1) what decides which elevator gets a request — and how would you swap that logic for a different scheduling algorithm without touching the rest of the system? (2) what notifies floor displays when an elevator's state changes, without the elevator needing to know which displays exist?
Design your own solution first — on paper, a whiteboard, or your own IDE — before checking the reference.