Home - RJAE5/2143-OOP GitHub Wiki

Welcome to the 2143-OOP wiki!

This wiki breaks down terms and concepts that were learned in CMPS 2143 - OOP with simple definitions. Each term has an associated page which dives into exceptional detail on the term with relevant examples.

Overview

Abstract Class:

A type of class that contains at least one pure virtual function and cannot be instantiated directly.

Abstraction:

The concept of displaying only essential information and ignoring irrelevant details.

Access Modifiers:

Keywords that set the accessibility of class members, such as private, protected, and public.

Attributes:

Specific values stored for each encapsulated item within a class. Each instance of the class gets a set of these attributes to manage.

Class:

A definition for a custom data type that bundles multiple data types with functions. A class can be instantiated to create one or multiple objects within a program.

Class Variable:

Variables in a class declared using the static keyword, which exist independently of instances of the class, and are shared across all instances

Collections:

A set of data structures provided by the Standard Template Library (STL), such as vectors, lists, sets, and maps, that store and organize data efficiently for various operations.

Concrete Class:

A class where all methods have a definition. This type of class can be instantiated directly.

Composition:

The use of an object of one class as a member of another class, indicating a "has-a" relationship.

Constructors and Destructors:

Special member functions executed when an object is created or destroyed.

Design Patterns:

Styles of programming using OOP to help solve problems in a flexible and efficient way (i.e. Singleton, Factory, Observer, Decorator, etc.)

Diamond Problem

An issue encountered when using hybrid inheritance that leads to ambiguity on which method to use from which classes.

Encapsulation:

The bundling of data (attributes) and methods (functions) that operate on the data, restricting access to some of the object’s components.

Exception Handling:

The concept of stopping errors from fatally ending your program, typically consisting of the steps "try", "catch", and "throw".

File I/O:

The concept of reading in from and outputting to a file.

Friend Keyword:

A keyword that allows specific functions to access private attributes of an object.

Generics and Templates:

Generics are implemented using templates, which allow functions and classes to operate with any data type.

Inheritance:

The mechanism by which one class (derived class) inherits the properties and behaviors of another class (base class).

Instance Variable:

The unique set of attributes that the instance of a class gets to manage.

Instantiate

To create an instance or object of a class; to give it state.

Interface:

A class containing only pure virtual functions.

Iterator:

A variable to be used in a loop which goes over each object within a container, or the built-in iterator for each C++ STL container which automatically matches the type of container.

Member Variable:

The variables declared within a class that are accessible to all methods of that class as well as derived classes. These represent what instances of a class can hold (AKA attributes).

Memory Management:

Dynamically allocating and removing memory during program runtime via the use of new and delete keywords.

Method:

A function within a class that operates on attributes of a specific instance or accomplishes background work.

Object:

An instance of a class that has state.

Object Relationships:

How different objects interact or are connected, including associations, aggregation, and dependency, which define how objects collaborate and share responsibilities within a system.

Object-Oriented Design Principles:

The broad list of concepts and principles which define object-oriented programming.

Operator Overloading:

The ability to define or alter the behavior of operators (e.g., +, -) for user-defined types.

Overloading:

Providing multiple definitions for the same function name, distinguished by parameter types or numbers.

Overriding:

The process of providing a new implementation for a virtual function in a derived class, which replaces the base class's version.

Polymorphism:

The ability of different classes to be treated as instances of the same class through inheritance, typically realized through function overriding.

Private Keyword:

An access specifier that makes a member within a class that is only accessible within the class it is declared.

Protected Keyword:

An access specifier that makes a member within a class inaccessible from outside the class but accessible by derived classes and friend classes.

Public Keyword:

An access specifier that makes a member within a class accessible from any other part of the program.

SOLID Principles:

The 5 main OOP principles:

  • Single-Responsibility Principle
  • Open-Closed Principle
  • Liskov Substitution Principle
  • Interface Segregation Principle
  • Dependency Inversion Principle

Static Keyword:

Used to initialize a variable only once and keeps the variable local.

Testing in OOP:

The process to ensure all of the objects interact with one another as they should.

Unified Modeling Language (UML)

A way of visualizing systems and software simply via the use of Unified Modeling Language (UML)

Virtual Keyword:

A way of allowing a function to be redefined or overridden in a derived class.