design elevator system
use the following design pattern:
-
command pattern
passengar send command object to control center, the control center send the command to different elevators. -
observer pattern
there is monitor in elevator or at the floor to display the elevator status, which need are like subscriber to the elevator status, this can push. -
status pattern
the elevator handle open door request, close door request in different way depends on the current status is moving or stay, so it's differnt behavior for different status, can use status pattern here.