Notes on SOLID
And, finish digesting this:
http://www.dzone.com/links/r/solid_design_principles_to_write_better_object_or.html
to finish this below:
1 Five reasons to favor composition over inheritance:
- Java doesn't support multiple inheritance.
- Better testability, easier to mock out the composed element. In order to
test a derived class, you need access to the superclass.
- Both approaches allow you to reuse code, but inheritance breaks
encapsulation. A subclass depending on parent's behavior for its
own is fragile.
- It's more flexible to be able to replace the composed object with another
and better object later.
- Gang of Four, Head First Design Patterns, etc. Smart people
recommend composition over inheritance.