W3 - INHERITANCE Flashcards
_ Inheritance _ Inclusion Polymorphism
W3-Q1: CHARACTERISTICS of INHERITANCE
_ Inheritance is the TIGHTEST relationship btw classes.
_ the most HIGHLY COUPLED + defined in hierarchical terms + supports both abstraction and polymorphism.
W3-Q2: What does a DERIVED class in an inheritance hierarchy include?
the ENTIRE structure of its BASE class and only defines those additional features that specialize its base class
W3-Q3: Inheritance is a relationship between user-defined types. What are those types?
_ CONCRETE types - their representation is part of their definition and is known
_ ABSTRACT types - their representation is NOT part of their definition and is unknown
#W3-Q3: _ Definition + Characteristics of ABSTRACT classes _ How can we complete its implementation? _ Can we create an instance of an ABSTRACT class?
_ An abstract class defines an INTERFACE to an inheritance hierarchy. _ an INCOMPLETE class in the hierarchy. _ by deriving a new class that adds the MISSING details. _ cannot
W3-Q4: The COMPLETE class is a CONCRETE class. True or False?
True
W3-Q5: What is a POLYMORPHIC OBJECT?
is an OBJECT that can have different types throughout its lifetime
W3-Q6: What are PROBLEMS that arise with DYNAMIC typing?
_ determining the dynamic type in copying a polymorphic object to another polymorphic object
_ specializing an operation for a dynamic type
_ excluding a specific type from most DERIVED selection
W3-Q7: What does The Liskov Substitution Principle state?
a function that uses POINTERS or REFERENCES to BASE classes must be able to use OBJECTS of DERIVED classes without knowing it
=> model our CLASSES on their behaviors NOT their properties and model our DATA based on properties and NOT on behaviors.