Friday 7 November 2014

Key Features of Event Driven Programs P1

A. Service Orientated: This feature provides a service to the user. The advantage of this feature is that it does not take much of the processing power. Thus preventing lag or slow processing. An example of service orientated could be that you put an alarm for 8:00 PM. The service would be the alarm going off at 8:00 PM.

B.Time driven: This feature runs a unique code in it's own unique time. It could even be in intervals. Like the previous example I mentioned about the alarm clock, it could be applied to this as well. Meaning that if we put an alarm for 8:00 PM, it could be an example of the Time Driven feature.

C.Event handlers: This feature is a form of interaction. For example if a user presses this button then this happens. Meaning that a unique action is carried out right after a unique event is triggered. An Example can be that if a user presses the "F5" button on the keyboard then it refreshes their desktop. Another example can be that while using Microsoft word, if we press "Ctrl" and then "S" then it would save our word document.

D.Trigger functions: These functions decide that which code is appropriate when a unique event is occurred. They also select the event handlers for unique events. An example could be if we use our fingers on a touch screen. If we slide our finger to unlock then it is an example of a trigger function.

E. Events: There are many types of events. Events triggered with the mouse can be the scrolling,clicking, and even moving. The right click would trigger events differently compared the the left click. Events triggered with the keyboard can be the buttons. For example the navigation keys. User Interface can also trigger events. Things like Web Browsers are an example.

F. Pre Defined functions:
  
   Pre defined functions are unique inbuilt functions that do specific jobs to meet the end user need.        They are inbuilt hence their name is "Pre defined".

       An example can be:

cPosition= sLastName.charAt(0);  //charAt(0) is a pre defined function. It links variable sLastName with cPosition to detect a position at position "0"

 System.out.println( cPosition); //System.put.println is a pre defined function. It prints out a message that shows position at 0 (of sLastName)

G. Local variables:

Local variables are variables that are defined to a specific function or subroutine or class/module and can't be accessed by other functions/sub routine.If some programmers are working on a big programme then it is useful to use local variables as they can be accessed easily for specific jobs,

     public class HelloWorld{

     public static void main(String []args){


   String sLastName= "Abbas";  // sLastName is a local variable inside the class HelloWorld

}
 }

H. Global Variable
Global Variables exist outside all functions and are accessible throughout the programme by any function/class. They are used for storage hence they can be accessed later on in the programme. However programmers do not like to work with Global Variables as they often cause bugs can consume memory behind the processes even though they are not being used in particular. Also, if the function is repeatedly, the global variable does not get renewed. Java does not have global variables.In VB6 it goes like this

Dim Num as Integer

Private Function PrintNum()

End sub

I. Parameter Passing:
Parameters are needed for a pre defined function in order for it to work. I will show you an example I have used previously for "Pre Defined functions".
 If we take a look at "cPosition= sLastName.charAt(0);". The integer in the brackets of .charAt(0) is the parameter that is being passed. It finds the character at position 0 . This is known as Parameter Passing.



J. Modularity

Modularity is the concept/idea or process of dividing the programme into different parts or sections. After it is divided, it can be tested and debugged section by section. This helps programmers to maintain the programme more efficiently. For example, if there is a bug, they would not go through all the code, they can test each function separately,for ease. It saves time and energy. Each function/module is independent from the other module/function. In the programme the user inputs are specific in the form or medium of "arguments" and the "result" or "output" is in the form of "return values"

K. Procedures: 
Procedures are a compilation or a body of statements that interact with each other to perform a specific function/operation or task for the user. The following is an example of a function/procedure from VB6. It takes two numbers and adds them together.
"Function Add(ByVal Number1 As Integer, ByVal Number2 As Integer) As Integer Add = Number1 + Number2 End Function"

L. Programming Libraries:
Pre compiled modules are saved,in object form, in a place called "library". The advantage of programming libraries is that once the routine is saved, it can be used again by a "linker" so we do not need to insert them to every software that requires the module. It could be accessed easily by the linker. It is usually stored in a .DLL file. Basically, without Libraries, we can not run a programme as the procedures are stored in it.

M. Event Driven Programming Paradigm:

Event Driven Paradigm has to do with interaction. By interaction I mean user inputs. For example, when the user presses this button then this happens, if user presses that button then that happens. This can have to do with our washing machine, microwave etc

J. Two event driven languages:

1. Java    2.  C++

Java is class based and object orientated.  The syntax comes from C and C++.

C++ is an intermediate level language. It also contains Object Orientation. It was used to Modify "C" language 

1 comment:

  1. Lucky Club Online Casino Site Review 2021
    Lucky Club casino site provides the most reputable and 카지노사이트luckclub trustworthy site for the industry and provides a fantastic live casino experience. Rating: 8.7/10 · ‎Review by LuckyClub.me

    ReplyDelete