5

I am looking for the best term to use to describe a child that inherits an ancestor.

For example, a 'Car' object may derive from its ancestor 'Vehicle'. However, is there a better/more suitable word to use than derivative for the inverse?

Niall Walker
  • 155
  • 1
  • 12

3 Answers3

8

Ancestor/Descendant are a more common pairing when there can be intermediate layers between the items under discussion.

E.g. if we have Vehicle -> Wheeled Vehicle -> Car (and assuming other possible classes also exist), both Vehicle and Wheeled Vehicle are ancestors of Car and both Wheeled Vehicle and Car are descendants of Vehicle. We would describe Vehicle as the parent of Wheeled Vehicle and Car as a child of Wheeled Vehicle but we wouldn't generally use parent or child to describe the relationship between Vehicle and Car.

Damien_The_Unbeliever
  • 234,701
  • 27
  • 340
  • 448
2

"Inherited class" and "derived class" work well. At times instances of objects have parent/child relationships that have nothing to do with inheritance, like parent nodes and child nodes. In those cases referring to "parent" and "child" classes in the same context could be confusing.

Also, using the parent/child metaphor, every child is a parent, not every parent is a child, and some classes are infertile (sealed.)

Scott Hannen
  • 27,588
  • 3
  • 45
  • 62
1

Parent and child

So a car derives from it's parent vehicle; and a vehicle has multiple children such as car, boat and plane.

Puddler
  • 2,619
  • 2
  • 17
  • 26