Inheritance, Composition, & Data Effic

12 Karteikartenvon Nijelous
Diese Karteikarten lernenKostenlos · Spaced Repetition · iPhone, Android, Mac & Web

Alle Karten

1
Inheritance
Paradigm of OOP, the traditional way this is extended.
Children and Parents
2
Problems with Inheritance
Diamond of Death: Two subclasses of a main class, and an object that could take from either.

Difficult to change classes after multiple levels of inheritance

Can have wasted data if we completely ignore a layer of a subclass
3
Composition
Extending objects by adding extra classes onto the objects they're attached to.

Provided via components in Unity, where the update method for all of these is fired together.

Each component can access their parent object easily.
4
Problems with Composition
Two components could be far apart in memory, even on different lines, causing cache misses
5
ECS
Entity Component System
Allows us to organise data so it's in cache when we want it, leading to further efficiency.
6
True ECS
Entities are integers, and the software has a series of containers holding components.

Accessing n element of the container is a component for the nth entity.

Components are stored as data, functions are separated

Components are placed in contiguous order, in an order that makes sense for how they'll be accessed, using different data types to store some components
7
Freelist
A list of deactivated objects that can be reused so new objects don't need to be made, leading to a faster runtime.

If we need an object of a type, check the freelist. If it's there, take it from the list and set the details accordingly, otherwise allocate a new object.
8
Singleton
Ensure a class only has one instance, and provide a global point of access to it
9
Prototype
A type of extension which gives an object a clone method, making an identical copy in a very quick way.

E.g. Prefabs
10
Factory
Hides as much of the cloning process as possible, helping make instantiation simple.

Gives an object that matches a set of given parameters.
11
Service classes
Classes that can queue up requests, and work through them a fixed amount per frame.
12
Toolbox
A class/struct that holds a lot of different services that many objects use. Aka Handlers.
Alle 12 Karten kostenlos lernen

Mehr Karteikarten: Informatik

ITEC110 part 142 KartenInformatik · EnglischsabCSE 2102 Exam 136 KartenInformatik · EnglischImALegend_IL통신, 우편의, 은행 (telecommunication, postal, bank)31 KartenInformatik · Koreanisch모기1.1.1 Structure and function of the processor24 KartenInformatik · EnglischSabs2023Week 2 - Overview of Computer Systems19 KartenInformatik · Englisch—Griffith—L.1 computer system servicing 14 KartenInformatik · EnglischstudentSYO-601 Attack Frameworks9 KartenInformatik · Englischr3lykCompTIA Acronyms320 KartenInformatik · EnglischashleighLinux Networking Fundamentals100 KartenInformatik · EnglischAndrewComputer Architecture: Threads and Processes75 KartenInformatik · EnglischbaunieeHuman-Computer Interaction: Direct Manipulation64 KartenInformatik · EnglischIshanIT104 GMU Midterm practice52 KartenInformatik · EnglischIsaac

Alle Decks: Informatik

Lerne diese Decks in der App

Kostenlos auf iPhone, Android, Mac und im Web. Füge jedes Deck mit einem Tipp zu deinem Konto hinzu.

Laden im App StoreJetzt bei Google Play
Alle 12 Karten kostenlos lernen