PROGRAMMING
Key Features of Event Driven Programs
Service oriented: Service orientated is a programming paradigm that's specifically used to write programs that are made for services. If something is requested, the action will be carried out, if a user wanted to minimize an application that they're currently using, they'd click the icon in top right of the page to minimize it into the task bar, this is service orientated.
Time driven: Time driven programmes like antivirus scans, task schedulers and operating systems are pretty important features when it comes to maintaining and running your PC. These events follow real time settings and variables in their programming generally are generally used to plan out maintenance and update tasks that occur on future dates and at future times. Because of the time settings they can be planned to take place at regular intervals that don't have to be independently monitored by the user.
Event handlers:
Event handlers within programming are sections of code that are made to denote the actions of event triggers within the structure of the code, for example, the effect it will have on the programme if you right or left click. The image above shows an example of sub procedure created in visual basic that uses the trigger of closebutton_click which means that a button within the programme will close when the user triggers it by clicking.
Trigger functions: Trigger functions are used to be able to designate a specific coded event with an action, for example, clicking a button to trigger the calculation on a calculator which works out the result based on the numbers you put in.
Events: Events can actually be sub categorized into five different categories which refers to different hardware and software uses of events. The five are, mouse events, keyboard events, HTML object events, form events and user interface events.
-Mouse events:
Mouse events refer to actions that are performed by the mouse which can be dependant on either mouse buttons or mouse motions and movement sensor.
-Keyboard events:
Keybaord events refer to actions that are performed with a keyboard, this is dependant on either individual key presses of any keys on the board or a combination, such as ctrl+alt+delete, causing the Windows menu to appear.
-HTML object events:
HTML events such as onclick, onmousemove and onkeydown is used in online applications using software like JavaScript and CSS. These triggers are not to be confused with hardware mouse and keyboard despite them being similar.
-User interface events:
User interface events are one of the key features of event driven programming because most applications that are made using event driven programming, like calculator apps use buttons as a graphical representation of the numbers.
Predefined functions:
A predefined function can be placed after a variable and parameter.
A predefined function is a charAt which lets you find a specific position in a string e.g;
String sName;
sName=’Maison’;
char cPosition;
cPosition=sName.charAt(0);
System.out.println(“The letter at position 0 is”+cPosition)
Another predefined function is string.replace() which lets you replace a string
Local variables:
Local variables have the largest scope compared to the other variables. This variable is only accessible from the function or block where it is declared. Every local variable is immediately contained in a block ({...}) Local variable declaration statements can be mixed with other kinds of statements if they are in the same block. Local variables declaration have one single modifier and only one can be used. Local variables aren't actually given default initial values, they have to be initialized before they are used.
public class Cat{
public void kittenAge(){
int age = 0;
age = age + 7;
System.out.println("Kitten age is : " + age);
}
public void kittenAge(){
int age = 0;
age = age + 7;
System.out.println("Kitten age is : " + age);
}
public static void main(String args[]){
Kitten = new Kittent();
test.kittenAge();
}
}
Global variables:
Global variables are variables that are visible throughout the program unless hidden, the set of all global variables is known as the global environment. To define Global Variable you need to make use of static keyword.
public class Software {
public static int a;
public static int b;
}
Parameter passing:
Parameter passing allows the variable values to be passed through the program to the procedure, look at the image of the code below, specifically, 'System.out.println( "Some Text Here" );', that's what will be displayed.
https://www.youtube.com/watch?v=YbBFZu8YJ-Y
Modularity:Parameter passing:
Parameter passing allows the variable values to be passed through the program to the procedure, look at the image of the code below, specifically, 'System.out.println( "Some Text Here" );', that's what will be displayed.
https://www.youtube.com/watch?v=YbBFZu8YJ-Y
Modularity is the definition of a modular programme. Modular programming is breaking up a computer program into separate sub-programs. A module is a separate software component. It's often used in a wide range of applications and functions with other components of the system.
Procedures:
Procedures are small programs that are known as sub-programs, procedures can actually be used to avoid repetition when you're creating your program. Procedures are a set of tasks, tasks, that can be carried out in an order, they can also be used to carry out certain actions you want them to.
Programming libraries:
A programming library or libraries(plural) is a pre-compiled routine like code, class, procedure and script which is able to be specified and used by a programmer when developing an application programme.
Event driven programming for simplicity of programming and ease of development:
Event driven programming can be a lot simpler and easier to use and program as it's more visual, for example, when you create things like buttons you can simply just select it and place it onto a form and then add the code to the button. Pre-written code can also be used in event driven programming along with the ability to select commands from drop down lists which show the commands that can be used, allowing for a faster development time, not to mention it becomes simpler and easier.
Examples of languages that use event driven programming:
Visual basic and C# use event driven programming.
Event Driven Operating Systems
There's many different ways that an operating system (OS) could be referred to as an event driven application. The first thing that's on an OS that could be considered event driven is the fact that the start button, typically on the bottom left of the screen, is activated through a click event. When you click the button it'll come up with other functions that can be done. The action was the button being clicked and the event that followed.
Another good example of how the operating system can be classed as event driven is the fact that there's drag and drop characteristics on the desktop. For example, the most common place to see the Recycle Bin on a computer desktop is normally in the top left corner. Another time drag and drop occurs on a computer desktop is when you want to place one thing inside another thing, for example; when you want to put a typed word document into a folder with similar documents.
Another good example of operating systems are event driven is the fact that when the user presses a key on the keyboard, it's registered as a KeyDown command which is linked with other data that's linked with the press, like which key the user's pressed. An example of this would be when you've created a new folder and you want to input a new name to it. The event here would have been when you were typing and the reaction being the fact the letters appeared on screen.
Event driven programming can be a lot simpler and easier to use and program as it's more visual, for example, when you create things like buttons you can simply just select it and place it onto a form and then add the code to the button. Pre-written code can also be used in event driven programming along with the ability to select commands from drop down lists which show the commands that can be used, allowing for a faster development time, not to mention it becomes simpler and easier.
Examples of languages that use event driven programming:
Visual basic and C# use event driven programming.
Event Driven Operating Systems
There's many different ways that an operating system (OS) could be referred to as an event driven application. The first thing that's on an OS that could be considered event driven is the fact that the start button, typically on the bottom left of the screen, is activated through a click event. When you click the button it'll come up with other functions that can be done. The action was the button being clicked and the event that followed.
Another good example of how the operating system can be classed as event driven is the fact that there's drag and drop characteristics on the desktop. For example, the most common place to see the Recycle Bin on a computer desktop is normally in the top left corner. Another time drag and drop occurs on a computer desktop is when you want to place one thing inside another thing, for example; when you want to put a typed word document into a folder with similar documents.
Another good example of operating systems are event driven is the fact that when the user presses a key on the keyboard, it's registered as a KeyDown command which is linked with other data that's linked with the press, like which key the user's pressed. An example of this would be when you've created a new folder and you want to input a new name to it. The event here would have been when you were typing and the reaction being the fact the letters appeared on screen.