Mindmap
Object Oriented Programming: Inheritance
Inhalt der Mindmap
Object Oriented Programming: Inheritance
Inheritance
- What Is It?
- A way to create a child class that "inherits" all the data types and functions of the parent
- What Is It For?
- Avoid duplication! Write code once in the parent and then use it in all the children.
- Keep common code in one place. If you ever have to update it you can change the parent and automatically update all the children
- What Is It?
Overrides
- What is it?
- Replace an inherited function with a child specific function of the same name
- What is it for?
- A class that mostly acts like it's parent with one or two exceptions
- Keep the same "interface" as the parent but act differently
- What is it?
Super Keyword
- What is it?
- A way to override an override and call the original parent function
- What is it for?
- Mix custom and default behavior
- What is it?
Polymorphism
- What is it?
- Child classes can be grouped like they are an instance of the parent class but will still use overrides to behave like their unique sub class
- What is it for?
- Convenient way to group similar items into one array or collection. No more creating one collection per class type!
- Stop worrying about which objects are which class. Trust each class to call the right version of overridable methods.
- What is it?
Informationen
- Beschreibung
- Mindmap am Object Oriented Programming: Inheritance, erstellt von Scott Cornaby am 06/08/2019.
- Erstellt von
- Scott Cornaby
- Aufrufe
- 0
- Bewertung