• Post Reply Bookmark Topic Watch Topic
  • New Topic

compare inheritance and design patterns  RSS feed

 
shaon husain
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Design Patterns are one form of reuse. so is inheritance. what are the similarities and difference between them?


 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Design patterns and inheritance are really two completely different things, so it is a bit strange to compare them like this.

They are also not mutually exclusive, in fact, many design patterns make use of inheritance. It is certainly not the case that people think "ok, I want to reuse some code - what should I choose, design patterns or inheritance?".
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!