inheritance or composition

Suppose we are working as a software developer in a company. we have been given a task to develop a software system design. One of the basic activities of any software system design is to establish relationships between classes. Suppose at the stage of creating relationships for some classes, we have to choose either inheritance or composition as these are two fundamental ways to relate classes by achieving feature of code re-usability. as a developer, for what reasons, would we prefer one technique to the other keeping in mind the reusability factor?

Topic archived. No new replies allowed.