Event driven programming is suitable for creating non-graphical applications too because all of the features that it has are also very efficient at non-graphical as well as graphical programming. Although probably even more suitable for non-graphical than graphical, since it was designed for non-graphical. An example of a non-graphical but event driven program would be a program that detects hardware changes, it will see your specs and register them then if it changes that triggers an event that will notice the change in hardware, like one that will detect you plugging in a USB drive and realises it and takes control of the drive for your ease of access.
One of the main features that make event-driven programming a suitable and reliable form of creating Graphical User Interfaces (GUI) is the service oriented technique. This is because it is simple, yet amazingly efficient at creating graphical based interfaces. Another would be the time driven technique, because it can be used from anything to calculating how long the user took to do something from setting off set events that activate at certain times in time zones while the program is running in the background. All of the features that are contained within event-driven programming are beneficial to the programming of graphical interfaces. This makes the technique more than capable of being a suitable language technique for coding graphical user interface based programs, and more than capable of doing a good job compared to other techniques. A style of coding where a programs overall flow of execution is dictated by events. An example of an event-driven graphical program would be a program that checks to see the system specs of your computing device then displays them to you, then if hardware changes it changes with it.
Service Oriented Programming
Service Oriented Programming is a technique of Event-Driven Programming that employs the use of services as the unit of computer work, to design and implement integrated graphical interfaces. Time-Driven Programming Time-driven programming is another technique of event driver programming that is based around time, the control flow of it is driven by a clock and is often used in Real-Time Computing. This technique gives everything a periodic activation pattern, the activation patterns are stored in a dispatch table ordered by time. Event Handlers Event handlers are methods of containing program statements that have been executed in response to and event, typically a software routine that registers actions such as sound input and key-presses. Trigger Functions Event driven programming uses trigger functions to select what event handler needs to be ran for the event which has occurred. Events An event in event driven programming is for example: A key input, mouse movement, user string input and so on. Pre-Defined Functions A pre-defined function is a single function that can be input and processed by the compiler to mean something that was defined by the language being used. For example in Java: "System.out.print ();" is a pre-defined function that when compiled into machine code means print whatever is between the () from system output. Local Variables A local variable in event driven programming is a string that you define locally to mean a certain variable. For example in Java: You could use "int iExample1 = 10;" and that would locally define the string iExample1 to mean 10. Global Variables A global variable is a variable pre-defined by the compiler to mean something, like "getName.User" in certain languages if you type that it will output the defined name of the user of the program and if the user has not input a name it will return "Nil". Parameter Passing In C# arguments can be given to parameters, by value or by reference. Passing by reference allows the use of function members, properties, indexers, operators, methods, and constructors to change the value of the parameters and have that change persist in the calling environment. Modularity Modularity in event-driven programming is the ability to emphasize separating the functionality of a program to single modules, as each contains everything necessary to execute only one command. Procedures Procedures in event-driven programming are basic techniques, you would use them to do everything in procedures and not start with one process and change over to the other without finishing what you are doing. Also it can be taking certain procedures to make sure that you are doing everything correctly. Programming Libraries Programming libraries are specific pre-defined libraries in programming that can be imported into your code to add new features. For example: "import javax.swing.*;" would import a library that you use but not define. Like "JOptionPane". Event Driven Programming Overall Overall, event driven programming is about simplicity and ease of development. Despite how advanced I've made it seem, those features actually make the technique one of the most simple and quick ways of developing high end programs / applications. Two programming languages that are suitable for the technique of event-driven programming are Java and C#, I will provide an example for Java. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- import javax.swing.*; public class WageCalculator { public static void main(String[] args) { int iExample1 = 10; int iExample2 = 12; int iExample3; iExample3 = iExample1 + iExample2; String sExample1 = JOptionPane.showInputDialog(null,"Write something here.","Example Program",JOptionPane.WARNING_MESSAGE); // This is a graphical input dialog. if (sExample1.contains ("Orange")) { int iExample4 = JOptionPane.showConfirmDialog(null,"You wrote the correct thing.","Example Program",JOptionPane.QUESTION_MESSAGE); // This is the graphical //output dialog. } } } ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |