Chapter 3 - Inheritance, Class Hierarchy, UML, OOP vs Procedural Programming Flashcards

1
Q

OOP (8)

A
  1. divided into objects
  2. importance is given to data rather than functions because it works with real world objects
  3. bottom up (design objects then interactions)
  4. different specifiers are used for different levels of data protection
  5. data can only move via member functions
  6. public or private access specifiers are used to control data access
  7. more secure because of data hiding
  8. function overloading and overloading operator
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

procedural programming (8)

A
  1. divided into small functions
  2. importance is given to procedures before data
  3. top down (design functions first)
  4. no access specifiers
  5. data can move freely from function to function
  6. global data is acceptable and freely accessible
  7. no particular method for data hiding, so less secure
  8. overloading is not possible
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

UML private, public and protected symbol

A

private: -
public: +
protected: #

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

UML function syntax

A

string getName() or getName() string are both acceptable, virtual functions are italicized

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

UML interfaces

A

has strictly pure virtual functions, italicized class names, <> (not in italics) above the class name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

UML abstract functions

A

at least one pure virtual function but other functions may be defined, italicized class name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

UML inheritance (“is-a”)

A

white triangle arrowhead facing the parent class, means that every instance of one class is also an instance of the other class but not the other way around

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

UML inheritance (“has-a”)

A

filled diamond arrow facing toward the class that “has” the other thing in it, means that every instance of one class is or may be associated with one or more instances of the other

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

UML inner class

A

when we define a class within a class, circle with a cross through it with the circle closest to the class that contains the inner class/structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

abstract class

A

cannot be instantiated (objects cannot be created), declares at least one abstract member function (which must be defined in its derived classes), used when a base class can define attributes and functions that are common to derived classes or when actual derived classes may have unique and shared implementations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

abstract function or pure virtual function

A

virtual function that is declared but for which no body (definition) is provided
form: virtual function-declaration = 0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

pure abstract functions

A

must be defined by derived concrete classes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

multiple inheritance

A
the ability of a class to extend more than one class, all data fields for the derived class are inherited from its base classes, constructors are called in the same order in which they are called
form: class Object_Name : public Derived_Class1, public Derived_Class2 { };
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

refactoring

A

a better solution than multiple inheritance, the creation of a separate common base class, often used in object-oriented design, sanitizing your code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

namespaces

A

used to group collections of declarations into a fictional unit, nested
form: namespace name {…}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

using declaration

A

takes a name from the namespace in which it was declared and places it into the namespace where the using declaration appears
form: using namespace::name;

17
Q

using directive

A

takes all the names from a given namespace and places them into the namespace where the using directive appears
form: using namespace namespace-name;

18
Q

friend function

A
gives the functions and classes it specifies access to the private and protected members of the class in which the friend declaration appears, not transitive
form: friend function-name;
friend class class-name;
19
Q

Left hand value (l-value)

A

Must be valid memory location

20
Q

Right hand side (r-value)

A

May be function, must be the same type as l-value

21
Q

UML

A

Unified modeling language

22
Q

ADT

A

Abstract data types

23
Q

polymorphism

A

the quality of having many forms or many shapes, enables the program to determine which member function to invoke at run time

24
Q

dynamic casting

A

enables us to process objects referenced through a pointer variable of its actual type