Two common concepts in object-oriented design are “Is-A” and “Has-A.”
An Is-A relationship, more formally called a subclass or parent-child relationship, is when one kind of object is a type of some other kind of object. For example, a Customer is a Person.
You can model Is-A relationships by using subclassing. For example, you can derive the Customer class from the Person class. The Person class includes all the properties and methods that are generally applicable to persons, and the Customer class adds those that apply only to customers. (Note that using two classes would be overrefinement if Person has no other child classes, such as Employee.)
A Has-A relationship, more formally called composition, is when one kind of object ...