Ch 68 - Object-oriented design principles

call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/13

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:59 AM on 5/21/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Add student to class section state
Add studentsNo students in these sections. Invite them to track progress!

14 Terms

1
New cards

Inheritance

The process of creating a new class based on an existing class (superclass)

<p>The process of creating a new class based on an existing class (superclass) </p>
2
New cards

Superclass

The class that is being inherited from

3
New cards

Subclass

The class that is inheriting from the superclass

4
New cards

Polymorphism

A concept in programming that allows an object to take on different forms or behaviours

5
New cards

Overriding

A method of polymorphism where the same identifier in the superclass is redefined in the subclass

6
New cards

Association

The relationship between two classes

7
New cards

Aggregation

An association where one class contains or references another, but can still exist independently from the the other class

<p>An association where one class contains or references another, but can still exist independently from the the other class</p>
8
New cards

Composition

A strong association where one class contains another contained class that is fully dependent on the container. If the container is destroyed, the contained object is also destroyed.

<p>A strong association where one class contains another contained class that is fully dependent on the container. If the container is destroyed, the contained object is also destroyed.</p>
9
New cards

Abstract method

A method declared in a base class that does not have an implementation. Instead, it is used as a placeholder and must be overridden by subclass methods.

10
New cards

Virtual method

A method declared with an implementation in a base class that can be optionally overridden or inherited from by other subclasses

11
New cards

Static method

A method that is associated with the class itself rather than any object, and it can be called without instantiating the class.

(It essentially groups a bunch of methods under one class name for clarity, used in a lot of python libraries, e.g pygame.display.update())

12
New cards

Interface

A collection of method declarations that must be implemented by any class that uses it. It allows unrelated classes to follow the same protocol.

13
New cards

OOP design principles

  • Encapsulate what varies

  • Favour composition over inheritance

  • Program to interfaces, not implementation

14
New cards

Why is the OOP paradigm used?

  • Modularity - Breaks down code into classes and objects with clear responsibilities

  • Reusability - Through inheritance, existing code can be used without rewriting

  • Maintainability - OOP is easier to understand and update

  • Encapsulation - Internal object data is hidden from the outside interface

Explore top flashcards

flashcards
A and P unit 1
51
Updated 134d ago
0.0(0)
flashcards
Fundamentals of Nutrition
115
Updated 29d ago
0.0(0)
flashcards
Chapter 4 Vocabulary
47
Updated 1028d ago
0.0(0)
flashcards
Wheelock Ch 35 Vocab
20
Updated 1063d ago
0.0(0)
flashcards
Latin Etyma Wk 3
26
Updated 937d ago
0.0(0)
flashcards
Buddhism Beliefs Key terms GCSE
34
Updated 650d ago
0.0(0)
flashcards
HGAP Units 1-4 Vocab
287
Updated 799d ago
0.0(0)
flashcards
Lessons 19-21
30
Updated 1118d ago
0.0(0)
flashcards
A and P unit 1
51
Updated 134d ago
0.0(0)
flashcards
Fundamentals of Nutrition
115
Updated 29d ago
0.0(0)
flashcards
Chapter 4 Vocabulary
47
Updated 1028d ago
0.0(0)
flashcards
Wheelock Ch 35 Vocab
20
Updated 1063d ago
0.0(0)
flashcards
Latin Etyma Wk 3
26
Updated 937d ago
0.0(0)
flashcards
Buddhism Beliefs Key terms GCSE
34
Updated 650d ago
0.0(0)
flashcards
HGAP Units 1-4 Vocab
287
Updated 799d ago
0.0(0)
flashcards
Lessons 19-21
30
Updated 1118d ago
0.0(0)