I want to design a Elevator Simulator using SOLID principles.
Each elevator has a set of states.
• Maintenance: the elevator does not react to external signals (only to its own signals).
• Stand: the elevator is fixed on a floor. If it receives a call. And the elevator is on that floor, the doors open. If it is on another floor, it moves in that direction.
• Up: the elevator moves up. Each time it reaches a floor, it checks if it needs to stop. If so it stops and opens the doors. It waits for a certain amount of time and closes the door (unless someting is moving through them. Then it removes the floor from the request list and checks if there is another request. If so the elevator starts moving again. If not it enters the state stand.
• Down: like up but in reverse direction
NOTE: Some elevators don't start at bottom/first_floor esp. in case of sky scrappers. min_floor & max_floor are two additional attributes for Elevator.
Can somebody help me to design my classes which satisfy all the SOLID principle..
Thanks in advance...
Aucun commentaire:
Enregistrer un commentaire