Classical Software Engineering
Quiz 13 :
The fourth iteration of elevator problem case study is as follows: 1. When a user press the button to request an elevator to go up. The Floor button informs Floor Subcontroller that floor button has pressed. 2. The Floor Subcontroller sends message to Floor button to turn On and send message to Scheduler that Elevator is going in up direction. 3. The Sensor send message to Elevator Subcontroller when elevator is about to reach. The Elevator Subcontroller sends a message to Scheduler to check if the elevator is required to stop at the coming floor or not. 4. If the Scheduler reply's No then the Elevator Subcontroller again send a message to elevator to move up to next floor. If the Scheduler reply's yes, then the request logged in step 1 is cancelled and elevator Subcontroller send the message to elevator door to open and starts the timer. 5. Now the user enters the elevator and presses the Elevator Button which the Elevator Subcontroller informs to Elevator door to close. Next the elevator Subcontroller sends a message to elevator to move up one floor. 6. The Sensor informs Elevator Subcontroller that elevator has left the floor which in turn informs Floor Subcontroller. The floor Subcontroller sends a message to the Up floor button to turn off. 7. Elevator Subcontroller sends messages to elevator to move. The Sensor informs the Elevator Subcontroller when elevator is about to reach the required floor. 8. Elevator Subcontroller send message to scheduler to check if to stop at the coming floor. If Yes the request is removed, Elevator Subcontroller send message to Elevator button to turn off and also send message to Elevator door to open 9. The user steps out of the elevator. Elevator Subcontroller sends a message to elevator door to close and Elevator Subcontroller send message to elevator to move as required. The statechart for Elevator Class is as follows: The class diagram is as follows:
Start chart diagram: • It is one of the UML diagrams used to describe the system's dynamic nature in a diagram manner. • In a lifetime, there are different states of the object are used, every state change into events. • It is very useful to create the reactive systems that responds to the internal or external events. • It is a flow diagram defines the control of a system from one state to another. • It is a model of a system where it begins as a creation to termination of each individual objects. • It is also used for forward and reverse engineering systems. Draw of a state chart diagram: • It shows the life cycle of the different objects to describe the states. • It shows the changes in the internal and external events. The important step is to describe the states. • First, need to analyse the important objects. • Then the states are needs to be identified. • Finally, the events are needs to be declared. In a diagram, • The first state is an initial state also called as an idle state where the process begins. • Then the events are arrived at a sequence for the requests like send, receive, confirm and delivered. • In those events, the state changes into the objects in an order. • It follows through the different states in the complete life cycle. • The final state is an exit state and also the abnormal exit occurs due to the system problems. • The complete transaction is done where the lifecycle of a system is completed. Start chart diagram for the Button Class: Process: • The first state is an initial state. • The button class sends the request to the floor button class and the elevator button class. • The elevator button class sends the control to the elevator sub controller class. • The floor button class sends the control to the floor sub controller class. • The elevator sub controller class communicates with sensor class and elevator class. • The elevator sub controller class sends the control to the elevator door class. • Then, elevator sub controller class and floor sub controller class communicates with scheduler and process the requests. • The requests are processed and sends back to the button class. • The complete transaction is done.
Every software product moves from state to state. In each state of the software operations are performed and then go to the next state and then to final state. So, a state chart is a model of how the execution will be done for the software product. Statechart provide the information of the state, event and operations to be performed on each state of the software product. The statechart for Elevator Class is as follows: