Many electrical devices are “event driven”. An event simply means an input or output. For example, a computer is programmed to respond to a mouse click, or a keyboard press. When this event (input) happens, an action (output) will occur, for example opening of a window, or text appearing on a word processor. However some applications that are event driven don’t have a graphical display to show the events happening. We may call some of these devices “Intelligent”.
Identify two applications that either use a text-based interface or have no graphical components. A program with no graphical components might be PC-based or a control application for a device such as a burglar alarm or fire alarms; and an "intelligent" microwave or an "intelligent" washer/dryer.
You need to identify the events (inputs) that each of these applications would receive and say how suitable an event driven language might be to handle those events. Application 1: Web Server Idly sits around doing nothing until a client makes request to view a page. The application detects that the client has connected to the server. An event handler then allows this user to download and view the page. This wouldn’t be considered an intelligent application.
An event driven language such as Visual Basic would be suitable to handle the events happening in this program, as it could prioritise the events in case multiple requests were sent at the same time. Application 2: “Intelligent” Washing Machine Event Driven Programming would be quite suitable for use with a non-graphical application such as a washing machine. We know this type of programming would be suitable because a washing machine needs an Event Trigger (the user pushing a button, or turning a dial) to begin the cycle.
The washing machine will not function without this trigger. Event Driven Programming has a Time Driven feature, this will check for various events (spin cycle, dry cycle, and stopping of the machine) making EDP very suitable. As the machine goes through its various cycles, it must do so based on the current load and settings of the machine. These cycles cannot be a fixed value so the machine must trigger the events based on the correct level of water in the drum and the weight of the washing. Finally, when the door to the washer is opened, the washer must stop immediately.
This could happen at any time, so the washer needs to have a trigger that the machine will react to, and stop spinning. Conclusion To conclude, event driven programming is very suitable for use with non-graphical applications. This is due to its simplicity, for example, being idle until a trigger activates an event. EDP’s suitability with these applications could also be down to the fact that multiple programming languages can be used to design the application. This makes it very easy to make as you are not relying on just one language.