Key Features of Event Driven Programs
Service Orientated
Service orientated is a service that applications all have. Phones have this in a way which you set an alarm and the outcome is for your phone to wake you up this is the service that you want he application to do.
Time Driven
time driven programming is a form that depends on the systems internal clock to execute operations at a time preset by the code related to the operation. an example of this would be the alarm application on your phone, you set the time and then when the internal clock reaches the time you set it will trigger the alarm on the phone.
Time Driven
time driven programming is a form that depends on the systems internal clock to execute operations at a time preset by the code related to the operation. an example of this would be the alarm application on your phone, you set the time and then when the internal clock reaches the time you set it will trigger the alarm on the phone.
Event Handlers
Trigger Functions
They are functions that are run when a certain event happens. What's actually happening is the program waits for you to press a key or cause some other change in the devices, and then sends a signal to the process. This wakes it up, and runs the trigger function
Events (e.g. Mouse Keyboards clicks)
An event occurs when the user interacts with a object. Usually this means a mouse movement or click. Keyboard actions are also events. An event is the outcome of an action. There are two important terms with respect to events. The event source and the event receiver. The object that raises the event is called event source and the object that responds to the event is called event receiver
An event occurs when the user interacts with a object. Usually this means a mouse movement or click. Keyboard actions are also events. An event is the outcome of an action. There are two important terms with respect to events. The event source and the event receiver. The object that raises the event is called event source and the object that responds to the event is called event receiver
Pre-defined Functions
A pre-defined Function is lots of pre existing code that is there for the end user to use. Most programming IDE's will have pre-defined functions so that it easier on the user and written in style of English so users can understand what is going on. an example of a pre-defined function in Java is .length() this will look at how many characters are in the string and tell you the number of letters:
String sGreeting;
sGreeting="Hello";
int length;
sGreeting.length();
System.out.println("Greeting " + sGreeting);
Local Variables
A local variable is something that is declared within the body of a method, you are not declaring this variable in the public class because that would be a Global Variable. When you create a local Variable other methods in that class are not even aware that its there. an example would be declaring it in the public static void main body:
public class HelloApp
{ public static void main(String[] args) { String sHelloMessage; helloMessage = "Hello World"; System.out.println(sHelloMessage); }}
Global Variables
A global variable must be available everywhere, it must also be able to be used by function at any time. It's like given a piece of information about you to the public and they can do what they wish with that information.
Parameter Passing
The basic understanding of parameter passing is is a variable or value that you pass in to a function. Each parameter must have a unique name and a defined data type.
In Java you put parameter under the main public class for example:
String sName;
public void setName (String sNewName){
sName = sNewName;
}
Modularity
Procedures
A procedure performs a specific task in the code. A function will return a value whereas a procedure will just execute the commands. this an example in C the source will be linked at the bottom
void display( int n ) {
printf( "The value is %d", n );
Programming Libraries
A Programming library is pre-compiled code that is stored for later use in a program. Libraries are particularly useful for storing frequently used routines because you do not need to explicitly link them to every program that uses them.
Event Driven Paradigm
The event driven programming paradigm is when the flow of a program is determined by events such as user actions, Keyboard clicks, mouse and a whole other range of peripherals. Event driven programming is the most used paradigm for graphical interfaces, they are centered for using user input of their applications.
2 examples of languages using Event driven programming
The first language and the one we have really focused on is Java this is great for doing graphically user interfaces as you will see in the example.
As you can see this graphics box was made in java. The user interacts with the OK and Cancel button, whilst also entering the name with keyboard strokes.
The next example is in Visual Basic, this is great tool if your just starting to learn the basics of coding and is handy as it has pre made functions and GUI's to play around with.
As you can see the graphics box was made in Visual basic. The user interacts by inputting 2 numbers in which then program will perform the method you choose by clicking the radio buttons.
Linux
Another example would be when you input a USB stick and it comes up with the multiple options of what files to open and what software to open them with. For example, if you have videos on your pen drive, it will ask if you want to open them up in software player Ubuntu recommends you. The event in this instance is when you put the pen drive in and the consequence is the operating system deciding to use that particular software.
Apple
The final thing that I am going to use to tell you that an operating system is a type of event driven application or program is the fact that when you click on the shut down, the operating system gets shut and stops the power supply getting through the power supply unit and getting to the other key components that are required to run the computer. The event in this instance is the user clicking the Shut Down button and the reaction from the operating system is the computer going off.
Suitability of Event Driven Languages - D1
Event-driven programs are just those that respond to some kind of requests and sit idle at other times. These are often graphical applications where the requests are things like clicking buttons. But there are other examples of event-driven programs that are not graphical. For example a server application could be event driven in that it does nothing until a client makes a request. There are many things in household appliances that have a non-graphical interface but use event driven languages for example.
A washer will use event driven code, the user will press the button spin on the washer, it will process it and the washer will begin to do the carried out task. This is just the simplest form of event driven being used without a GUI.
A 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.
Another example of technology that uses non graphical applications would be cars. The example that I am going to use would be when the sensor in the fuel tank notices that the fuel is getting low, it switches a light on on the dashboard which shows the driver that the car needs fuel. I believe that this is suitable for event driven programming because it would make the drivers life a lot easier because if the light didn't work, the driver would either have to look down the fuel filler tube which is very difficult or completely take the fuel tank off which is even harder.
The event driven programming paradigm is when the flow of a program is determined by events such as user actions, Keyboard clicks, mouse and a whole other range of peripherals. Event driven programming is the most used paradigm for graphical interfaces, they are centered for using user input of their applications.
2 examples of languages using Event driven programming
The first language and the one we have really focused on is Java this is great for doing graphically user interfaces as you will see in the example.
As you can see this graphics box was made in java. The user interacts with the OK and Cancel button, whilst also entering the name with keyboard strokes.
The next example is in Visual Basic, this is great tool if your just starting to learn the basics of coding and is handy as it has pre made functions and GUI's to play around with.
As you can see the graphics box was made in Visual basic. The user interacts by inputting 2 numbers in which then program will perform the method you choose by clicking the radio buttons.
Event Driven Operating Systems - M1
Windows
Windows is great for showing graphical user interfaces, most of the world uses windows because of its ease to navigate around. The first graphic you will probably go to on windows first is the start button at the bottom left of the desktop, it is activated through a click event. When you click on the button, it comes up with a list of other functions that can be done. The action was when you clicked on the button and the event that occurred because of it was the list of buttons opening up.Linux
Another example would be when you input a USB stick and it comes up with the multiple options of what files to open and what software to open them with. For example, if you have videos on your pen drive, it will ask if you want to open them up in software player Ubuntu recommends you. The event in this instance is when you put the pen drive in and the consequence is the operating system deciding to use that particular software.
Apple
The final thing that I am going to use to tell you that an operating system is a type of event driven application or program is the fact that when you click on the shut down, the operating system gets shut and stops the power supply getting through the power supply unit and getting to the other key components that are required to run the computer. The event in this instance is the user clicking the Shut Down button and the reaction from the operating system is the computer going off.
Suitability of Event Driven Languages - D1
A washer will use event driven code, the user will press the button spin on the washer, it will process it and the washer will begin to do the carried out task. This is just the simplest form of event driven being used without a GUI.
A 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.
Another example of technology that uses non graphical applications would be cars. The example that I am going to use would be when the sensor in the fuel tank notices that the fuel is getting low, it switches a light on on the dashboard which shows the driver that the car needs fuel. I believe that this is suitable for event driven programming because it would make the drivers life a lot easier because if the light didn't work, the driver would either have to look down the fuel filler tube which is very difficult or completely take the fuel tank off which is even harder.
No comments:
Post a Comment