Inheritance, Composition, & Data Effic

12 flashcardspar Nijelous
Réviser ces flashcardsGratuit · répétition espacée · iPhone, Android, Mac et web

Toutes les cartes

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.
Réviser les 12 cartes gratuitement

Plus de flashcards : Informatique

ITEC110 part 142 cartesInformatique · AnglaissabCSE 2102 Exam 136 cartesInformatique · AnglaisImALegend_IL통신, 우편의, 은행 (telecommunication, postal, bank)31 cartesInformatique · Coréen모기1.1.1 Structure and function of the processor24 cartesInformatique · AnglaisSabs2023Week 2 - Overview of Computer Systems19 cartesInformatique · Anglais—Griffith—L.1 computer system servicing 14 cartesInformatique · AnglaisstudentSYO-601 Attack Frameworks9 cartesInformatique · Anglaisr3lykCompTIA Acronyms320 cartesInformatique · AnglaisashleighLinux Networking Fundamentals100 cartesInformatique · AnglaisAndrewComputer Architecture: Threads and Processes75 cartesInformatique · AnglaisbaunieeHuman-Computer Interaction: Direct Manipulation64 cartesInformatique · AnglaisIshanIT104 GMU Midterm practice52 cartesInformatique · AnglaisIsaac

Tous les decks : Informatique

Révise ces decks dans l’app

Gratuit sur iPhone, Android, Mac et le web. Ajoute n’importe quel deck à ton compte en un tap.

Télécharger dans l’App StoreDisponible sur Google Play
Réviser les 12 cartes gratuitement