3.1 Object Hierarchy and Generalization

Cards (11)

  • Object Hierarchy; a way of organizing objects into families based on their shared characteristics and attributes
  • Objects clustered in a category serves as the specifications of that category while the category itself is the generalization of those objects
  • Generalization / Specification; hierarchic in nature
  • Superclass; More general
  • Subclass; More specific
  • Inheritance; An object-oriented paradigm instilled on classes/objects that is knows as an 'is a' relationship
  • Inheritance; fundamental concepts in OOP that allows us to define a new class based of an existing class
  • Superclass; the existing class
  • Subclass; new class
  • By inheriting from a superclass, the subclass automatically inherits all the attributes and methods of the superclass.
  • Inheritance allows us to reuse code and avoid duplication code across multiple classes, leading to more efficient and maintainable implementation.