event driven programming lesson 2

0.0(0)
studied byStudied by 15 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/36

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

37 Terms

1
New cards

Event driven programming

is the programming paradigm in the field of computer science.

2
New cards

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

3
New cards

Event driven programming

g is currently the default paradigm in software engineerin

4
New cards

Main loop

which constantly polls for new events and calls the matching event handler(s) when a registered event is received.

5
New cards

Service oriented

is a programming paradigm that is used to write programs that are made for services.

6
New cards

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.

7
New cards

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,

8
New cards

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.

9
New cards

Pre defined function

is a function that is built into the programming language. C# provides some pre-defined methods such as Main ()

10
New cards

MOuse, keybaord and user interfacer

examples of events

11
New cards

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.

12
New cards

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.

13
New cards

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.

14
New cards

Value, Reference or ref, Out or reference, and params or parameter arrays

What are the four different ways of passing parameters

15
New cards

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

16
New cards

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.

17
New cards

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.

18
New cards

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

19
New cards

ref

s a mechanism of parameter passing by reference

20
New cards

out

s also a mechanism of parameter passing by reference

21
New cards

true

A variable to be sent as ref parameter must be initialized.

22
New cards

true

A variable to be sent as out parameter don't need to be initialized

23
New cards

bidirectional

ref is —— i.e. we have to supply value to the formal parameters and we get back processed value.

24
New cards

unidirectional

Out is a —- i.e. we don't supply any value but we get back processed value

25
New cards

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

26
New cards

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.

27
New cards

module

is a construct representing a unit of code (set of types, values, functions and any expression allowed by a language) and satisfying

28
New cards

procedures

are small programs that are known as sub-programs, procedures can be used to avoid repetition when creating a program.

29
New cards

procedures

are a set of tasks, that can be carried out in an order, they can be used to carry out certain actions.

30
New cards

Programming libraries

they contain pre-compiled routines, this can be source code, data files, script, templates, fonts or code form.

31
New cards

Encapsulation

A module may hide or make abstract some of its components

32
New cards

independence

A module should depend only on the interfaces of its dependencies.

33
New cards

Interface

A module may publicly provide and require a set of components.

34
New cards

params

specify a method parameter that takes an argument where the number of arguments is variable

35
New cards

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.

36
New cards
37
New cards