What an event driven
language is:
Event Driven: These respond to events and an example would
be a louse click. This is an example of modern programming because they need to
have the responses to a large variety of events that GUI operating systems
provide. An advantage is that it allows you to add sounds to a task such as an
alarm clock for when it reaches a certain time it will make a soundSpy. A
disadvantage is that this doesn’t allow you to enter event loops and doesn’t
allow a user to do it manually.
A description of one
event driven language:
Python is an
object-oriented high-level programming language. It is useful for Rapid
application Development and also for scripting. However it doesn’t need to run
on a high specification computer. The syntax of python allows programmers to
express concepts in less code than was ever available in C++ or Java.
Typical events in
your chosen language:
The typical events in
python are from mouse-clicks or keyboard presses. So when a mouse is clicked or
a keyboard is pressed then an event will happen which has code behind it to
make it happen. A common event is the turtle, so when the turtle is open and anywhere
within that page is clicked, a line will form from point to point.
What features of the
language are available?
All of the features
of python are available to all users because it is free and open source.
What are the
advantages of your language?
Python is an easy
programming language to learn and has a simple syntax which means the majority
of people will start with python as their first language and develop from
there. Python is also free and open source which means that anyone can use it and
also its source code is available so users can implement their own code to help
if they wish to do so. Python is portable so that it can be used on many platforms.
What are the
disadvantages of the language?
A major disadvantage
to python is that it is slow to use. It is also not a very good language for
mobile development so if a programmer wants to use a program to develop mobile
code then they should use a different language. Python isn’t a good language to
use for creating a high graphic 3D game.
File saving is another example to show that operating
systems are event driven applications because when typing on word and the file
is saved it is written onto a disk. A user will save it because they were using
work for a reason and they won’t want to retype a document every time they
leave that application. The event in this case is clicking the save button and
the action is the file being saved to a hard drive or a USB.
Operating systems
are event driven applications
The first reason that operating systems are an event driven
application is that the start button in the bottom left corner is initiated
through a click of a mouse. When the button is clicked, a list of programmes
and functions appear. The action here was a mouse click and the event was the
programmes and functions appearing.
A
second example of an operating sytem being an event driven application is the
drag and drop capability to copy files and folders from different locations on
a computer. For example when programmes such as Internet Explorer or Google Chrome
are first installed, their desktop icon joins a list of other programmes on the
desktop. At first they follow on from the other programmes at the left hand
side of the screen but thye can be moved from place to place depending on the
decision of the user. Drag and drop also occurs when a word document is to be
moved inside a folder rather than just on the desktop. The action here is
clicking on and dragging the file and the event is the file being dropped into
the folder to its new loaction.
When a key is pressed on a keyboard this is referred to as
an event which also shows how an operating system is an event driven
application. When a key is pressed this is registered as a Key Down command
which shows which key has been pressed. This happens when a new folder is
created and a folder name needs to be inputted. The event is typing on the
keyboard and this results in text appearing in the box.
When on the start menu and scrolling through the icons which
are there on the menu, this is another example of an operating system being an
event driven application. When the icons are hovered over, they are highlighted
with a blue glow if still on Windows 7 and this will differ slightly on newer
or older versions. The event here is hovering over the icon and the reaction
being the blue glow.
Another
exapmple which shows that an operating syste is an example of an event driven
application is when a USB stcik is
inserted and the popup shows options of the files which can be opened and the
software avaiable to them. For example if you had any form of music on the USB
it will recommend that you open the files in Windows media player or another
suitable software. The event is inserting the USB stick and the reaction is the
operating sytems recommending suitable softwares.
These
are the majority of examples of operating sytems being an event driven
application. This example is to show how
switching users is also event driven. When on the start menu, there is a menu
which has options such as swithcing user, shutting down and locking the
machine. When each button is selected, this is an event and depending on which
was clicked will result in the reaction.
The
final example to an operating system being an example of an event driven
application is that when it gets shut down, it completely shuts down and the
power is stopped from running from the power supply to the computer. The event
is clicking shut down and the reaction is the computer turning off.
A washing machine can be programmed using event driven
languages so that when the start button is pressed, it triggers an event to
make it start its cycle. There are different settings available which mean that
different events need to be selected for example for how long it will spin for. Event driven programming is suitable for washing machines because there are different settings available for different types of washing.
A cooker can be programmed with event driven programmes by
the different settings available, for example if you wanted to cook something
slowly then the low setting will be selected and vice versa for a higher
setting. Another example on a cooker would be selected the correct temperature,
this will be different for every different food that is going to be cooked. Event driven programming is suitable for a cooker because it allows difffernt styles of cooking and timers for what is being coooked.
A microwave uses event driven programming by selecting
different settings such as low medium and high. There are also the presets for
meat, fish and rice which make the microwave cook for the required time for
these presets. When the microwave finishes the cooking time, it will make a
ding sound which is caused by the time finishing.
Mobiles are also event driven programmes because when you
press the home button ion a phone when it’s locked it will go to the lock
screen. Also if a phone has a finger print sensor, then holding down on it will
unlock the phone. The finger being placed is the event and the phone unlocking
is the reaction.
Thermostats are another non-graphical example of an event
driven programme. As the temperature changes in a room, the mercury on a
thermostat will either rise or decrease. The event here is the temperature
change and the reaction is the mercury changing.
Alarm systems are also event driven because when a time is
set for an alarm to go off this is an event for setting the time. The reaction
here is when the alarm goes off at the set time.
DVD players are another example because when the eject
button is presses the disc tray will open, the event here is pressing the
button and the reaction is the tray opening. Another feature of a DVD player is
the standby button which is again event driven when the button is pressed. DVD
players also have remotes to control it form further away. The remote has loads
of different buttons which could be pressed which all have different events to
them and different reactions.