1.2 programming paradigms

studied byStudied by 10 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 31

32 Terms

1

procedural programming

programming paradigm where programs are formed from sequences of instructions and broken down modularly into routines and subroutines

New cards
2

characteristics of procedural programs

-instructions are executed in the order in which they appear

-subroutines can be called from anywhere in the program

-data is stored as variables and constants

-data structures can have a local or global scope

New cards
3

structured approach to program design and construction

uses assignment, sequence, selection and iteration

New cards
4

characteristics of the structured approach

-designed from the top down(elements are broken down into smaller tasks)

-keeps programs easy to understand and maintain as they are easier to navigate

-testing can be carried out on individual modules

-easier to develop collaboratively as each module can be assigned separately

New cards
5

hierarchy charts

charts representing the structure of a structured program

each procedure is diaplayed as a rectangle and connected to parent or child procedures with a line, with parent procedures above their children

New cards
6

object-oriented programming

programming paradigm where programs are formed from, and designed around, objects which contain their own properties and methods

New cards
7

OOP main principles

inheritance, encapsulation, abstraction and polymorphism

New cards
8

why OOP is used

-programs have a clear structure which makes developing and testing easier, as well as splitting projects among teams

-the use of classes allows code to be reused throughout the program(and sometimes in other programs) improving readability and data efficiency

New cards
9

class

a blueprint for objects specifying their properties and methods

New cards
10

properties and methods

data and instructions in a class, respectively

can be public or private(accessible from anywhere in the program, or only from within the object and its inheritors)

New cards
11

class definitions

lists of a class's name, properties and methods in text form

New cards
12

object

containers of data and instructions created from a class

New cards
13

instantiation

the creation of an instance of an object from a class using a constructor

New cards
14

constructor

a method in a class called to create and initialise an object from it, assigning a reference to a variable of the class type

constructors can be implicit(automatic, with default parameters) or explicit(eith user-defined parameters)

New cards
15

encapsulation

the process of combining properties and methods to form a class

New cards
16

inheritance

the process by which a class is given the properties and methods of another class in addition to its own, in an is-a relationship

New cards
17

overriding

when a class inherits another it can override its methods, changing the implementation but keeping the name(for itself, not the inherited class)

New cards
18

association

when classes are connected in 1-1, 1-m or m-m relationships, allows them to interact and collaborate by accessing eachothers' properties and methods

associated objects form part of their container object as a property, in a has-a relationship

New cards
19

aggregation

association where an object will continue to exist if its container object is destroyed

New cards
20

composition

association where an object will cease to exist if its container object is destroyed

New cards
21

polymorphism

where objects are processed differently depending on their class

New cards
22

OOP design principles

-encapsulate what varies

-favour composition over inheritance

-program to interfaces, not implementation

New cards
23

encapsulate what varies

components of a program which are likely to change should be encapsulated as it better protects against said changes unwantedly affecting other parts of the program

New cards
24

favour composition over inheritance

composition should be used over inheritance wherever possible as it is seen as more flexible

New cards
25

program to interfaces, not implementation

programming to depend on interfaces rather than implementations improves code flexibility, and allows unrelated classes to easily make use of similar methods

New cards
26

interface

a set of abstract procedures determining what methods an object should have, without providing the code for them

New cards
27

implementations

classes that fulfil the rules determined by interfaces and provide the code

New cards
28

class diagrams

used to visually represent the relationships that exist between classes

classes are represented by boxes with different connectors representing different kinds of relationship, can exhibit various levels of detail

<p>used to visually represent the relationships that exist between classes</p><p>classes are represented by boxes with different connectors representing different kinds of relationship, can exhibit various levels of detail</p>
New cards
29

inheritance diagrams

sshow inheritance relationships that exist between classes- unfilled arrows point from classes to their inheritees and always point upwards

<p>sshow inheritance relationships that exist between classes- unfilled arrows point from classes to their inheritees and always point upwards</p>
New cards
30

association in class diagrams

association is shown in class diagrams using diamond headed arrows, unfilled and filled diamonds correspond to aggregation and composition respectively

<p>association is shown in class diagrams using diamond headed arrows, unfilled and filled diamonds correspond to aggregation and composition respectively</p>
New cards
31

association in UML

in unified modelling language, association between two classes is modelled using lines

a normal line represents bidirectional association while a line with an arrow represents one-way association where a class can call the one the arrow is pointing to but not vice versa

New cards
32

class diagrams with properties and methods

class boxes are split into three, containing the class's name, properties and methods from top to bottom respectively

plus and minus signs in front of properties and methods denote they are public and private respectively

hashtags indicate protected properties or methods

<p>class boxes are split into three, containing the class's name, properties and methods from top to bottom respectively</p><p>plus and minus signs in front of properties and methods denote they are public and private respectively</p><p>hashtags indicate protected properties or methods</p>
New cards
robot