Thursday, 11 December 2014

Suitability of Event Driven Languages for Non-Graphical Applications

As with most things, there are advantages and disadvantages for using Event driven languages for non-graphical applications.
An advantage would be that it is easy to use, meaning a programmer can get a program made in rather quick time. Another advantage would be that the familiarity of the languages available means that the user will be able to easily create both types of programs. 

However, there are some disadvantages of using EDP for a non-graphical application.
One such disadvantage would be that the movement events would be rendered useless as these are graphical features, but in a non-graphical application there isn't any need for this.

An example of event driven programming being used for a non graphical application is a microwave. You would press a button and that would trigger an event from within the microwave (i.e. the components not the place where you cook food) and this event would then make a number show up on a small screen (showing the time or something similar). 

Another example would be an alarm clock. When you set an alarm, you are essentially creating an event to happen in the future. When this time is reached, an even triggers the alarm to go off, whether you like it or not (although you can put it on snooze of course).

Thursday, 4 December 2014

Key Features of Event driven Programs

Service Orientated
These are programs that have no user interface but can be started and stopped whenever a user requires it. Alternatively, they can be set to activate at a certain time. An example of this would be an alarm clock, where you can set it to go off at a specific time.
Time Driven
Time driven is a piece of code that is on a timer, and when the time has expired the piece of code runs and the timer resets. An example of this would be asking your PC's antivirus to run a scan to check for viruses.


Event Handlers
This is a specific piece of code that is set to run when a certain event is triggered. For example, if you were to press any letter on your keyboard, then there is a piece of code to make that key show up on the screen.

Trigger Functions
Trigger functions are mechanisms that decide what code to run when a specific event (e.g. when a key on a keyboard is pressed). So essentially, trigger functions are the mechanisms that select event handlers.

Events

Mouse
Moving a mouse in certain directions causes the cursor to respond accordingly. All of the clicking (e.g. left click, right click and so on) all have a specific event attached to them.

Keyboard
Each key on the keyboard has a preset event (which is basically some code that makes the letter you pressed to show up on the screen).

User interface
A user interface is basically what the user sees on his/her screen, and it is also designed to be understandable and user friendly.

Pre-Defined Functions
Predefined functions- Predefined functions are default pieces of code that can perform basic mathematical solutions. They are "built in" to the programming language itself.

Local Variables
Local Variables are variables like age, and have no default value, so a value must be declared. Local Variables are declared can be declared in various ways (one example being a method), and are created when the method is entered.

Global Variables
Global variables are variables that are declared outside of the function.It has a thing called a "global scope" which means it is defined everywhere in the java code.

Parameter Passing 

Parameters are values that are passed into a function or C++ template. For example, a function to add three numbers might have three parameters.

Modularity

Modularity (aka Modular Programming) is where you take one concept, and split it all up into separate sub-programs to create this concept.

Procedures: Procedures are singular parts of code that perform a single task, and is essentially the building board of the program. Procedures can also be called sub-programs, as they do look like small programs.


Program Libraries 
A program library is a collection of pre-compiled, reusable programming routines that a programmer can use when writing code so that the programmer doesn't have to write it out again and again, saving lots of time.

Event Driven Programming for Ease of Programming and Ease of Development
EDP can be a lot easier to use as  it is much more visual. Additionally, pre-written code is useful as it saves a lot of time , because you don't have to type all of the code out yourself.

Languages that use EDP
Visual basic uses event driven programming.
You can also use C# for event driven programming.

An example of Event Driven Code (Redo)

Thursday, 20 November 2014

Event Driven Operating Systems

How an Operating System is Event Driven 
One way an operating system is event driven is that the start menu (where you can view your programs and applications) is activated when you click on the start button. This is an event. As shown in the image, the windows logo has been clicked and the images of different programs has came up.

Another way an Operating System is event driven is that when you press a key on the keyboard, the OS then makes a key show up on the screen, whether you are renaming a folder or searching for something in the start menu.

As you can see, I have added a new folder to my desktop, and named it "Folder". The OS recognizes the keys I inputted and showed them to me on the screen.