1/36
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Event driven programming
is the programming paradigm in the field of computer science.
Event driven programming
In this type of programming paradigm, flow of execution is determined by the events like user clicks or other programming threads or query result from database. Events are handled by event handlers or event callbacks
Event driven programming
g is currently the default paradigm in software engineerin
Main loop
which constantly polls for new events and calls the matching event handler(s) when a registered event is received.
Service oriented
is a programming paradigm that is used to write programs that are made for services.
Time driven
is a paradigm, it is code that runs on a time trigger, this could be a piece of code that runs at a specific time, which could be once a week or whenever a program is launched, this means it is a preset task.
EVent Handlers
is a function or method that takes place when a certain event happens, they are executed in response to a certain event that takes place, for example this could be on a button, when a button is clicked the code is ran, if the button is clicked again after that it will run again,
Trigger function
decide what code is ran when a specific event occurs, they are used to choose when event handlers are ran for the event that occurs, most applications have a trigger function for each event that is likely to occur.
Pre defined function
is a function that is built into the programming language. C# provides some pre-defined methods such as Main ()
MOuse, keybaord and user interfacer
examples of events
Local variable
e is a variable that is declared within a method, that variable will only be used by the method where it is mentioned, other methods will not use it.
Global variable
is a variable that can be used in every part of a program, java doesn’t use global variables as it can make a program harder to control and can make it harder to manage variables.
PArameter passing
g is used by a function, it allows a value to be passed through a program, it can be used for many things, including an alarm or finding a certain character at a certain position, though on an alarm, the event doesn’t take place until a certain time has come, this is due to events.
Value, Reference or ref, Out or reference, and params or parameter arrays
What are the four different ways of passing parameters
passing parameter by value
In this method a duplicate copy is made and sent to the called function. There are two copies of the variables. So if the value was changed in the called method it won't be changed in the calling method
Passing parameter by ref
uses the address of the actual parameters to the formal parameters. It requires —- keyword in front of variables to identify in both actual and formal parameters.
Passing parameter by out
Like reference parameters, —- parameters don't create a new storage location and are passed by reference. It requires out keyword in front of variables to identify in both actual and formal parameters.
passing parameter by param
t is used when we don't know the number of parameters will be passed to the called method. —- can accept multiple values or "params" should be a single dimensional or a jagged array
ref
s a mechanism of parameter passing by reference
out
s also a mechanism of parameter passing by reference
true
A variable to be sent as ref parameter must be initialized.
true
A variable to be sent as out parameter don't need to be initialized
bidirectional
ref is —— i.e. we have to supply value to the formal parameters and we get back processed value.
unidirectional
Out is a —- i.e. we don't supply any value but we get back processed value
modularity
is modules that have been spread out into different parts of a program to carry out tasks one after the other, each module works separate and independently from the others
Modularity
can also be used to breakdown a large program into separate entities, this can make a big complicated system more straight forward and easy to understand, though it can increase the time it takes to develop the program.
module
is a construct representing a unit of code (set of types, values, functions and any expression allowed by a language) and satisfying
procedures
are small programs that are known as sub-programs, procedures can be used to avoid repetition when creating a program.
procedures
are a set of tasks, that can be carried out in an order, they can be used to carry out certain actions.
Programming libraries
they contain pre-compiled routines, this can be source code, data files, script, templates, fonts or code form.
Encapsulation
A module may hide or make abstract some of its components
independence
A module should depend only on the interfaces of its dependencies.
Interface
A module may publicly provide and require a set of components.
params
specify a method parameter that takes an argument where the number of arguments is variable
true
No additional parameters are permitted after the params keyword in a method declaration, and only one params keyword is permitted in a method declaration.