Inheritance vs Aggregation
When Inheritance and when Aggregation?
Inheritance should be used only if the relationship is-a is maintained throughout the lifetime of the objects involved; otherwise, aggregation is the best choice.
In other words, a subclass should always be a ...
bikash8848.hashnode.dev1 min read