Depends on the logical relationship. It just needs to make sense.
Example:
Let's say you have animal classes.
So, you have these classes: animals, dogs, cats, leopards, furs, legs
Cat and Dog IS A Animal.
Leopard IS A Cat.
Animal HAS A Fur, Feet.
In a nutshell:
The IS relationship means that you inherit and extend the functionality of a base class.
HAS A means that the class uses a different class, so it has it as a member.
Yochai timmer
source share