DEV Community

Discussion on: How do you choose between an interface and abstract class?

Collapse
 
dnltsk profile image
Daniel Teske

Is-a/has-a differenciation is reasonable. However in your Shape example I would use an IDrawable.
U need abstract classes e.g. when the template pattern needs to be implemented.
Cheers

Collapse
 
suhas_chatekar profile image
Suhas Chatekar

Shape example is just an "example" as it is most commonly understood by everyone. I think it is "Hello World" of inheritance.