• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

inheritance unnecessary?

 
Sanly Fang
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From previous posts, there are a lot of experience saying that no class inheritance can be ok, and it's not good to introduce inheritance too early in the design.

But this confuses me. How to deal with the Payment? I do think there are two types of Payment, CreditCardPayment and MileageAwardPayment, respectively, am I wrong?

Hope this question do not violate the forum's rules.
 
Yong How, Lim
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a general design rule, composite is preferred over inheritance.
As far as the assignment is concern, there is no rule forbidding you from using inheritance, just remember to justify your decisions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic